public class PersistentStreamSequencingPolicyProvider extends Object implements Function<Configuration,SequencingPolicy<? super EventMessage<?>>>
SequencingPolicies
for a given Configuration
.
The provided SequencingPolicy
for a given Configuration
returns a sequencing key for an event to
identify which sequence/stream the event belongs to. The policy is only used for when a dead letter queue is
attached to the processors consuming from a Persistent Stream.
Modifier and Type | Field and Description |
---|---|
static String |
FULL_CONCURRENCY_POLICY
A
String constant representing the full concurrency policy. |
static String |
META_DATA_SEQUENCING_POLICY
A
String constant representing the "meta-data" sequencing policy. |
static String |
PROPERTY_SEQUENCING_POLICY
A
String constant representing the property sequencing policy. |
static String |
SEQUENTIAL_PER_AGGREGATE_POLICY
A
String constant representing the "sequential per aggregate" sequencing policy. |
static String |
SEQUENTIAL_POLICY
A
String constant representing the sequential policy. |
Constructor and Description |
---|
PersistentStreamSequencingPolicyProvider(String name,
String sequencingPolicy,
List<String> sequencingPolicyParameters)
Instantiates a
PersistentStreamSequencingPolicyProvider based on the given parameters. |
Modifier and Type | Method and Description |
---|---|
SequencingPolicy<EventMessage<?>> |
apply(Configuration configuration) |
public static final String SEQUENTIAL_PER_AGGREGATE_POLICY
String
constant representing the "sequential per aggregate" sequencing policy. This means all events
belonging to the same aggregate are handled sequentially. The behavior of this policy resembles the
SequentialPerAggregatePolicy
.public static final String META_DATA_SEQUENCING_POLICY
String
constant representing the "meta-data" sequencing policy. The policy utilizes values present in
the metadata of an event to define the sequence identifier.public static final String SEQUENTIAL_POLICY
String
constant representing the sequential policy. This means all events are handled sequentially. The
behavior of this policy resembles the SequentialPolicy
.public static final String FULL_CONCURRENCY_POLICY
String
constant representing the full concurrency policy. This means all events are spread out over the
available segments, regardless of the sequence identifier. The behavior of this policy resembles the
FullConcurrencyPolicy
.public static final String PROPERTY_SEQUENCING_POLICY
String
constant representing the property sequencing policy. This policy retrieves a value from the
event's payload to decide the sequence identifier of the event. The behavior of this policy resembles the
PropertySequencingPolicy
.public PersistentStreamSequencingPolicyProvider(String name, String sequencingPolicy, List<String> sequencingPolicyParameters)
PersistentStreamSequencingPolicyProvider
based on the given parameters.name
- The processor name.sequencingPolicy
- The name of the sequencing policy.sequencingPolicyParameters
- Parameters for the sequencing policy.public SequencingPolicy<EventMessage<?>> apply(Configuration configuration)
apply
in interface Function<Configuration,SequencingPolicy<? super EventMessage<?>>>
Copyright © 2010–2024. All rights reserved.