0
votes

In apache storm what does collector.fail do ? Does it replay the tuple from the source(spout) or it just replays the tuple from the last bolt from which it was emitted ? Note: i'm not anchoring my tuples, so what happens in that case?

1

1 Answers

2
votes

As states in the documentation Guaranteeing Message Processing, the tuple will be replayed from the spout that generated it.

Each word tuple is anchored by specifying the input tuple as the first argument to emit. Since the word tuple is anchored, the spout tuple at the root of the tree will be replayed later on if the word tuple failed to be processed downstream. In contrast, let's look at what happens if the word tuple is emitted like this:

_collector.emit(new Values(word)); Emitting the word tuple this way causes it to be unanchored. If the tuple fails be processed downstream, the root tuple will not be replayed. Depending on the fault-tolerance guarantees you need in your topology, sometimes it's appropriate to emit an unanchored tuple.