Axon 3 and Spring Boot Autoconfigure: Customise SagaConfiguration


When using the spring boot auto configuration, how does one customise the SagaConfiguration, for example to add interceptors?


Hi Niel,

At the moment, the best way to customize the processors used to invoke and manage Sagas is to define a bean of type SagaConfiguration with the name of the saga, suffixed with “Configuration”. So if your saga is MySaga, call the configuration bean MySagaConfiguration.

You create the SagaConfiguration instance with one of the static methods (trackingSagaManager(…) or subscribingSagaManager(…)). Then, you can use the registerHandlerInterceptor(…) method to register the interceptors that you want to add.