In non-transactional topology, a spout emits a batch of tuples and doesn't guarantee what's in each batch. With a processing mechanism, we can divide the pipeline into two categories:
- At-most-once-processing: In this type of topology, failed tuples are not retried. Hence, the spout does not wait for an acknowledgment.
- At-least-once-processing: Failed tuples are retried in the processing pipeline. Hence, this type of topology guarantees that every tuple that enters the processing pipeline must be processed at least once.
We can write a non-transactional spout by implementing the org.apache.storm.trident.spout.IBatchSpout interface.
This example shows how we can write a Trident spout:
public class FakeTweetSpout implements IBatchSpout{ private static final long serialVersionUID = 10L; private intbatchSize; private HashMap...