Interface SequencingPolicy<M extends Message>

Type Parameters:
M - the type of message to sequence
All Known Implementing Classes:
ExtractionSequencingPolicy, FallbackSequencingPolicy, FullConcurrencyPolicy, HierarchicalSequencingPolicy, MetadataSequencingPolicy, NoOpSequencingPolicy, PropertySequencingPolicy, RoutingKeySequencingPolicy, SequentialPerAggregatePolicy, SequentialPolicy
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SequencingPolicy<M extends Message>
Interface to a policy definition for concurrent message processing.

Some implementations are provided by default:

  • SequentialPolicy: Requires that all messages are handled in the order they arrive. For event handling this also means that at most 1 thread is processing messages for this processor at any time.
  • FullConcurrencyPolicy: Allows each message to be handled independently of any other message. Message processing will typically start in the same order the messages were scheduled in, although no guarantees can be given about the actual processing order.
  • SequentialPerAggregatePolicy: Default event processing policy. Will force events (only supports event handling tasks) generated by the same aggregate to be handled sequentially. At most one thread will be processing events of a single aggregate at any time.
  • RoutingKeySequencingPolicy: Default command processing policy. Will force commands (only supports command handling tasks) routed for the same routing key to be handled sequentially.
  • ExtractionSequencingPolicy: Message processing policy that allows to extract the sequence identifier from the message payload.
  • MetadataSequencingPolicy: Message processing policy that allows to extract the sequence identifier from the message metadata.
  • PropertySequencingPolicy: Message processing policy that extracts the sequence identifier from the message payload based on a given property
  • FallbackSequencingPolicy: Message processing policy that allows two policies in an exception-based fallback behavior for sequence identifier extraction.
  • HierarchicalSequencingPolicy: Message processing policy that allows to combine two policies in a fallback pattern (similar to FallbackSequencingPolicy, but not exception based).
Since:
0.3
Author:
Allard Buijze