T- The type of the supported event payloads.
K- The type of the extracted property.
public class PropertySequencingPolicy<T,K> extends Object implements SequencingPolicy<EventMessage>
SequencingPolicyimplementation that extracts the sequence identifier from the event message payload based on a given property or property extractor. If the event message payload is not of a supported type, a fallback sequencing policy is used. By default the fallback sequencing policy raises an exception.
|Modifier and Type||Class and Description|
Builder class to instantiate a
|Modifier||Constructor and Description|
|Modifier and Type||Method and Description|
Instantiate a Builder to be able to create a
Returns the sequence identifier for the given
protected PropertySequencingPolicy(PropertySequencingPolicy.Builder builder)
PropertySequencingPolicybased on the fields contained in the
Will assert that the
propertyExtractor is not
null and will throw an
AxonConfigurationException if this is the case.
public Object getSequenceIdentifierFor(EventMessage eventMessage)
event. When two events have the same identifier (as defined by their equals method), they will be executed sequentially. A
nullvalue indicates that there are no sequencing requirements for the handling of this event.
public static <T,K> PropertySequencingPolicy.Builder<T,K> builder(Class<T> payloadClass, Class<K> propertyClass)
Upon initialization of this builder, the following fields are defaulted:
fallbackSequencingPolicydefaults to an exception raising sequencing policy.
payloadClasswhich defines the supported type of event message payload.
propertyExtractorwhich is applied to the payload and extract the sequence identifier.
fallbackSequencingPolicywhich defines the behaviour in case of an unsupported event payload.
T- the type of the supported event payloads
K- the type of the extracted property
payloadClass- the class of the supported event payloads
propertyClass- the class of the extracted property
Copyright © 2010–2021. All rights reserved.