Hi Team ,
Do we have any option in saga while publishing the command to set the partition id in the events to ensure same sequence should fall into same partition , .
How to access the header information like offset details while starting the Saga
Hi Team ,
Do we have any option in saga while publishing the command to set the partition id in the events to ensure same sequence should fall into same partition , .
How to access the header information like offset details while starting the Saga
Hi,
I am not sure if I understand the question correctly.
You are mentioning partitions. Axon term is segment
.
Tracking/Pooled processors can use multiple threads to process an event stream. They do so by claiming a segment that is identified by a number. Normally, a single thread will process a single segment.
The number of segments used can be defined. When an event processor starts for the first time, it can initialize a number of segments. This number defines the maximum number of threads that can process events simultaneously/in parallel.
Event handlers may have specific expectations on the ordering of events. If this is the case, the processor must ensure these events are sent to these handlers in that specific order. Axon uses the SequencingPolicy
for this. The SequencingPolicy
is a function that returns a value for any given message. This value is acting as a partition key essentially, as it will guarantee that all events with the same partition key (some event attribute) will go to the same segment.
SequentialPerAggregatePolicy is the default policy, and you can change that per processor, by implementing your own Seq policy to use some other event attribute as key (not aggregateId).
This sounds like a question coming from the Kafka corner of the world. Axon does not require you to define a segment identifier at all. Axon’s approach to segmenting (partitioning in Kafka terms) is by using the SequencingPolicy
@Ivan_Dugalic shared too.