Global event stream and local event stream

I occasionally see “An event processor fell behind the tail end of the event store cache”. I read the reply from Steven in this post:!searchin/axonframework/$20Axon$20Framework$20Users$20›$20Tracking$20processor$20falling$20behind$20the$20event$20store|sort:date/axonframework/y8TZ-pYoFvw/G4nWVWyWAgAJ

So this warning will show up whenever there are more events in event store but the Saga is still processing the previous event? Is there a tolerance or just lagging one event behind will cause consumer to switch to a local event stream

Another related question: My Saga has two event handlers. Is each handler a EventConsumer or just one EventConsumer for the one Saga? I think the second one is the correct answer?

Hi Chun Fu (I hope I am spelling that correctly?),

This message you’re seeing is not necessarily tied to a Saga.
The message comes up if one of the threads for a TrackingEventProcessor is falling behind in regards to event handling compared to the rest.
So, yes, this might be for a Saga, as a Saga might be backed by a TrackingEventProcessor; but really, it can be any type of Event Handling Component which receives its events from a Tracking Event Processor.

The decision when to move over from tailing the global event consumption towards a private stream, is based on whether a consumer has fallen behind the global consumer’s cache.
This ‘cachedEvents’ field can be configured for your EmbeddedEventStore.

For that, please take a look at the javadoc of the EmbeddedEventStore.Builder, as can be found here.

For your second question:
An Event Consumer typically services several Saga instances entirely.
So yes, you will not have an Event Consumer per Event Handler contained in a Saga, or any Event Handling Component to be exact.

I hope this helps you out!