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