Is there any way for ACK tuples in the storm bolt part

Since this is inefficient for all messages in the Storm, among all the components in my topology, only a few of them should guarantee message handling, and I would like to know if there is a suitable way to do this.

For example, I have TimingBolt

one that takes a tick-tuple to make the job run in a specific loop:

// 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 ensure that the message "Tick"

must be sent explicitly once per bolt afterTimingBolt

// 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 bolts other than TimingBolt

and AggregateBolt

can be out of range of the tree ACK

.

The doc http://storm.apache.org/documentation/Guaranteeing-message-processing.html says nothing about this. Is this a valid scene or is running ack from spout the only way to get acker to work?

+3


source to share


1 answer


You must start with the spout.

To be clear, you are not guaranteed to deliver messages using what is called a "trusted topology". Instead, you are guaranteed that either the tuple or all of its descendant tuples are fully delivered and processed, or that the spout is notified of an error. Failed messages can be automatically re-emitted, but eventually there is a small window in which the tuple is no longer repeated. For this to work, spout has some reliable, bolt-free tuples: (1) the ability to emit an object identifier using a tuple, and (2) methods that are called with that identifier when a tuple eventually succeeds or fails ( ack (id) and fail (id), respectively). Since bolts do not have this behavior, you cannot reliably start processing a tuple from a bolt.



Consider the direct tuning of the second bolt using TOPOLOGY_TICK_TUPLE_FREQ_SECS.

+2


source







All Articles