Axon 3 and Spring Boot Autoconfigure: Customise SagaConfiguration

Hi,

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

Thanks
Niel

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.

Cheers,

Allard