Class SegmentMatcher
java.lang.Object
org.axonframework.messaging.eventhandling.processing.streaming.segmenting.SegmentMatcher
Utility class that matches a resolved sequence identifier against a
Segment.
The sequence identifier is expected to be resolved through
EventHandlingComponent.sequenceIdentifierFor(org.axonframework.messaging.eventhandling.EventMessage, org.axonframework.messaging.core.unitofwork.ProcessingContext) before matching, so any fallback for a
SequencingPolicy that resolves no identifier is applied in a
single place. This guarantees that scheduling and handling route an event to the same segment.
- Since:
- 5.0.0
- Author:
- Mateusz Nowak
-
Method Summary
-
Method Details
-
matches
Checks whether the givensegmentmatches the givensequenceIdentifier, based on thehash codeof the identifier.- Parameters:
segment- the segment to match againstsequenceIdentifier- the resolved sequence identifier of the event to match- Returns:
trueif the sequence identifier matches the segment,falseotherwise
-