Understanding the “at-least-once” Guarantee
The windowing functionality in Storm core provides an “at-least-once”
guarantee. Values emitted from a bolt’s execute(TupleWindow
inputWindow)
method are automatically anchored to all tuples in
inputWindow
. Downstream bolts are expected to acknowledge the
received tuple (the tuple emitted from the windowed bolt) to complete the tuple
tree. If not acknowledged, the tuples are replayed and the windowing computation
is reevaluated.
Tuples in a window are automatically acknowledged when they exit the window after
windowLength + slidingInterval
. Note that the configuration
topology.message.timeout.secs
should be more than
windowLength + slidingInterval
for time-based windows;
otherwise, the tuples expire and are replayed, which can result in duplicate
evaluations. For count-based windows, you should adjust the configuration so
that windowLength + slidingInterval
tuples can be received within
the timeout period.