Let's start of by saying that I'm using version 3.1.2 of Axon Framework with tracking event processors enabled for both @EventHandlers
and Sagas.
The current default behaviour for creating event processors for Sagas, as I'm seeing it, is to create a single tracking event processor for a single Saga. This works quite well on a microservice scale, but might turn out to be a problem in big monolithic applications which may implement a lot of Sagas. Since I'm writing such application, I want to have a better control over number of running threads, which in turn will give me better control over usage of database connection pool, context switching and memory usage. Ideally, I would like to have as many tracking event processors as CPU cores where each event processor executes multiple sagas and/or @EventHandlers
.
I have already figured that I'm able to do that for @EventHandlers
via either @ProcessingGroup
annotation or EventHandlingConfiguration::assignHandlersMatching
method, but SagaConfiguration
does not seem to expose similar API. In fact, the most specific SagaConfiguration::trackingSagaManager
method is hardcoded to create a new TrackingEventProcessor
object, which makes me think what I'm trying to achieve is currently impossible. So here's my question: Is there some non-straightforward way that I'm missing which will let me execute multiple Sagas in the context of a single event processor?