JPA token entry segment have the same index

I have a saga event processor that has 6 segments running.
The segments were each running their own batch of events.

But now they seem to have been assigned the same batch to process.

The event processor are configured as PooledStreamingProcessor.

How can I avoid this behaviour?

Hi Miguel,

Event processing for Sagas is a bit different, in that every segment will process all events. For every segment, given the event any matching Saga instance will be fetched and the corresponding Saga event handler invoked.

/Marc

So does that mean that having multiple segments assigned to a saga can lead to an event being handled more than once?

Only if you have more than one Saga instance associated with the same value; in that case each instance (in its respective segment) will process the event.

But typically the mapping between association value and Saga instance is 1-1.

Makes sense.

Just as a sanity check, increasing the number of segments for a Saga will increase its processing speed, as long as the events belong to different saga instances.

It this correct?

Be aware that as all segments process every event, it means that the Saga store will, e.g. if you have X segments, be queried X times for every event. So while increasing segments in general increases parallelism, with Sagas (and large number of segments) this might actually become a bottleneck.