Class SequencingEventHandlingComponent

java.lang.Object
org.axonframework.messaging.eventhandling.DelegatingEventHandlingComponent
org.axonframework.messaging.eventhandling.processing.streaming.segmenting.SequencingEventHandlingComponent
All Implemented Interfaces:
DescribableComponent, MessageHandler, EventHandler, EventHandlingComponent

@Internal public class SequencingEventHandlingComponent extends DelegatingEventHandlingComponent
An EventHandlingComponent wrapper that ensures events with the same sequence identifier are handled sequentially.

This component uses the ProcessingContext to track the last invocation for each sequence identifier. When a new event arrives, it checks if there's an ongoing process for its sequence identifier. If so, it chains the new event's handling to occur after the previous one completes. If not, it handles the event immediately.

This class is marked as Internal, as users are not expected to interact with it directly. Instead, EventProcessors will wrap an EventHandlingComponent in this component to preserve the ordering.

Since:
5.0.0
Author:
Allard Buijze, Mateusz Nowak, Steven van Beelen