AnnotatedSagaManager javaconfig in multimodule project

Hi there,
While using axon + spring in multimodule project I wold like to setup some sagas (each saga has its own module).
For this I need to setup AnnotatedSagaManager.

AnnotatedSagaManager accessorRelationSagaManager(SagaRepository sagaRepository, EventBus eventBus, SagaFactory sagaFactory) {
    AnnotatedSagaManager annotatedSagaManager = new AnnotatedSagaManager(sagaRepository, sagaFactory, AccessorRelationSaga.class);
    return annotatedSagaManager;

Is it ok to have new sagamanager for each saga?
As I can see there isn’t simple way how to register one sagamanager for all of my sagas (the way could be with classpath scan of sagas).


Hi Lukas,

it’s perfectly fine to have a SagaManager for each Saga type. It does mean, however, that when you use the AsyncSagaManager, that each instance will se a different set of threads.That may be a good thing, or not, depending on your wishes.