As it's inefficiently to ack all messages in Storm, among the whole components of my topology, only some of them needs to guarantee message processing, and I'd like to know is there a proper way to do this.
For instance, I have a TimingBolt
which takes tick tuple to make the job work under a specific cycle:
// TimingBolt
@Override
public void execute(Tuple input) {
if (TupleUtils.isTick(input)) {
collector.emit(streamA, input, new Values("Tick"));
} else {
collector.emit(streamB, new Values("Message"));
}
}
I want to guarantee the "Tick"
message be sent explicitly once to the bolt after TimingBolt
// The AggregateBolt after TimingBolt
@Override
public void execute(Tuple input) {
if (input.getString(0).equals("Tick")) {
collector.emit(new Values("Get Tick"));
collector.ack();
} else {
// do something else
collector.emit(new Values("Not Tick"));
}
}
and I hope that bolts except TimingBolt
and AggregateBolt
could be out of range of the ACK
tree.
The document http://storm.apache.org/documentation/Guaranteeing-message-processing.html does not show anything about this matter. Is this a valid scene, or is starting ack from spout the only way to make the acker work?