Persistent streams on multi context

Hello everyone,

Today, we are using Axon Server with multiple contexts and working with StreamableEventProcessors.
My question is: Can we migrate to Persistent Streams with SubscribeEventProcessors in a multi-context setup?

That should most definitely be an option, @iheb090!
Just now that there is no ready-made migration tool to jump from a StreamingEventProcessor to a SubscribingEventProcessor using Persistent Streams.

Hence, if you want to ensure none of the Event Handling Components skip any events, you should either (1) let the Persistent Stream start where the StreamingEventProcessor ended or (2) allow some overlap by letting the Persistent Stream to start quite a bit before the point that your StreamingEventProcessor ended.

Option 2 would only be an option if your Event Handlers are idempotent since the overlapping events will be handled twice.

Let me know whether this suffices for you to proceed, @iheb090!

@Steven_van_Beelen Do you have an example about the option 1.

I don’t have a ready-made example for you, @iheb090. But, it is rather straightforward.

In the configuration of the Persistent Stream, as documented here, you can define the initialPosition.

The initialPosition should simply reflect the position where your StreamingEventProcessor ended.

In case of StreamingEventProcessors with several segments, I would recommend to pick the lowest position out of the set of tokens for a given Processor as the initialPosition on the Persistent Stream configuration.

I hope that helps!