Search code examples
apache-storm

storm: How does bolt executes tuple?


When the execute() returns, the bolt would be executed by next tuple? What happens if the bolt does not ack the previous tuple? In other words, could we ack the tuple after the execute() returns?

If the bolt do not ack one tuple for a long time, then by default, the spout would emit the parent tuple again to downstream, and the bolt would be executed by the same tuple again, right? what happens if the bolt ack an old tuple which is already considered failed by the spout?


Solution

  • If you don't ack the input tuple in a bolt, the spout will likely emit the root tuple again.

    Yes, it's fine to ack tuples after execute returns, as long as you do it within a reasonable timeframe (before the message timeout expires and the spout emits the root tuple again).

    If you ack a tuple that has expired, it has no effect.