public class MetaDataSequencingPolicy extends Object implements SequencingPolicy<EventMessage<?>>
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.Modifier and Type | Class and Description |
---|---|
static class |
MetaDataSequencingPolicy.Builder
Builder class to instantiate a
MetaDataSequencingPolicy . |
Modifier | Constructor and Description |
---|---|
protected |
MetaDataSequencingPolicy(MetaDataSequencingPolicy.Builder builder)
Instantiate a
MetaDataSequencingPolicy based on the fields contained in the
MetaDataSequencingPolicy.Builder . |
Modifier and Type | Method and Description |
---|---|
static MetaDataSequencingPolicy.Builder |
builder()
Instantiate a Builder to be able to create a
MetaDataSequencingPolicy . |
Object |
getSequenceIdentifierFor(EventMessage<?> event)
Returns the sequence identifier for the given
event . |
protected MetaDataSequencingPolicy(MetaDataSequencingPolicy.Builder builder)
MetaDataSequencingPolicy
based on the fields contained in the
MetaDataSequencingPolicy.Builder
.
Will assert that the metaDataKey
is not null
and will throw an AxonConfigurationException
if this is the case.
builder
- The MetaDataSequencingPolicy.Builder
used to instantiate a
MetaDataSequencingPolicy
instance.public static MetaDataSequencingPolicy.Builder builder()
MetaDataSequencingPolicy
.
The following fields of this builder are hard requirements and as such should be provided:
metaDataKey
key to be used as a lookup for the property to be used as the Sequence Policy.MetaDataSequencingPolicy
.public Object getSequenceIdentifierFor(@Nonnull EventMessage<?> event)
SequencingPolicy
event
. When two events have the same identifier (as defined
by their equals method), they will be executed sequentially. A null
value indicates that there are no
sequencing requirements for the handling of this event.getSequenceIdentifierFor
in interface SequencingPolicy<EventMessage<?>>
event
- the event for which to get the sequencing identifierCopyright © 2010–2025. All rights reserved.