Sagas with tracking processors

45 views
Skip to first unread message

mario.g...@gmail.com

unread,
May 16, 2018, 3:15:19 AM5/16/18
to Axon Framework Users
Hi 

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

Mario

Steven van Beelen

unread,
May 17, 2018, 3:42:36 AM5/17/18
to axonfr...@googlegroups.com
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.

Cheers,
Steven

--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages