Class MetaDataSequencingPolicy
java.lang.Object
org.axonframework.eventhandling.async.MetaDataSequencingPolicy
- All Implemented Interfaces:
SequencingPolicy<EventMessage<?>>
A
SequencingPolicy implementation that extracts the sequence identifier from the EventMessage's
MetaData, based on a given metaDataKey. In the absence of the given
metaDataKey on the MetaData, the EventMessage.getIdentifier() is
used.- Since:
- 4.6.0
- Author:
- Lucas Campos
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class to instantiate aMetaDataSequencingPolicy. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiate aMetaDataSequencingPolicybased on the fields contained in theMetaDataSequencingPolicy.Builder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Instantiate a Builder to be able to create aMetaDataSequencingPolicy.getSequenceIdentifierFor(EventMessage<?> event) Returns the sequence identifier for the givenevent.
-
Constructor Details
-
MetaDataSequencingPolicy
Instantiate aMetaDataSequencingPolicybased on the fields contained in theMetaDataSequencingPolicy.Builder.Will assert that the
metaDataKeyis notnulland will throw anAxonConfigurationExceptionif this is the case.- Parameters:
builder- TheMetaDataSequencingPolicy.Builderused to instantiate aMetaDataSequencingPolicyinstance.
-
-
Method Details
-
builder
Instantiate a Builder to be able to create aMetaDataSequencingPolicy.The following fields of this builder are hard requirements and as such should be provided:
- The
metaDataKeykey to be used as a lookup for the property to be used as the Sequence Policy.
- Returns:
- A Builder to be able to create a
MetaDataSequencingPolicy.
- The
-
getSequenceIdentifierFor
Description copied from interface:SequencingPolicyReturns the sequence identifier for the givenevent. When two events have the same identifier (as defined by their equals method), they will be executed sequentially. Anullvalue indicates that there are no sequencing requirements for the handling of this event.- Specified by:
getSequenceIdentifierForin interfaceSequencingPolicy<EventMessage<?>>- Parameters:
event- the event for which to get the sequencing identifier- Returns:
- a sequence identifier for the given event
-