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
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
-
Field Summary
Fields inherited from class org.axonframework.messaging.eventhandling.DelegatingEventHandlingComponent
delegate -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the component with givendelegateto receive calls. -
Method Summary
Modifier and TypeMethodDescriptionhandle(EventMessage event, ProcessingContext context) Handles the giveneventwithin the givencontext.Methods inherited from class org.axonframework.messaging.eventhandling.DelegatingEventHandlingComponent
describeTo, sequenceIdentifierFor, supportedEvents, supports
-
Constructor Details
-
SequencingEventHandlingComponent
Constructs the component with givendelegateto receive calls.- Parameters:
delegate- The instance to delegate calls to.
-
-
Method Details
-
handle
@Nonnull public MessageStream.Empty<Message> handle(@Nonnull EventMessage event, @Nonnull ProcessingContext context) Description copied from interface:EventHandler- Specified by:
handlein interfaceEventHandler- Overrides:
handlein classDelegatingEventHandlingComponent- Parameters:
event- The event to handle.context- The context to the giveneventis handled in.- Returns:
- An
empty streamcontaining nothing.
-