Sagas with tracking processors


we have modeled some business processes using sagas in order to coordinate the arrival of related events and synchronously fire messages to an external system when some conditions are met.

Events are read from RabbitMQ queues and go through a subscribing event processor which publish them to the event bus.

When a communication with the external system is involved a transaction is open from the moment the event is read from RabbitMQ until the external system replies to our synchronous calls and we have observed that under heavy load this can lead to resource exhaustion.

We are thinking of replacing the subscribing event processors with tracking event processors so to break the transaction commit time and asynchronously communicate with the external system.

One problem we are facing is that we want the tracking processors to start tracking from the first event after startup without replaying all the events already consumed.

Is there any way to instruct a tracking processor to do so? The only solution I can foresee, for the time being, is to insert, before startup, a token in the token_entry table ‘up to date’ with the latest received event.

More in general, do you think this is a good approach? Or another approaches are possible for this use case?

Thanks and Kind Regards


Hi Mario,

This is a common issue I’ve been solving at clients as well. Sadly however, your assumption is right. At the moment you’ll have to do an insert into the token_entry table for a Saga token.

I did document this as a feature request for the framework, which we’re planning to resolve prior to release version 3.3.

So for now I have to give you sad news: yes you’ll have to insert it yourself. In the following major release you should be able to instruct the configuration such to instantiate a token at the end of the stream.