java.lang.Object
org.axonframework.messaging.eventhandling.processing.streaming.segmenting.SegmentMatcher

@Internal public final class SegmentMatcher extends Object
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 Details

    • matches

      public static boolean matches(Segment segment, Object sequenceIdentifier)
      Checks whether the given segment matches the given sequenceIdentifier, based on the hash code of the identifier.
      Parameters:
      segment - the segment to match against
      sequenceIdentifier - the resolved sequence identifier of the event to match
      Returns:
      true if the sequence identifier matches the segment, false otherwise