In 4.11.0 of Axon Framework, Spring Boot auto-configuration support for MessageHandlerInterceptors and MessageDispatchInterceptors was introduced.
For those curious how this was achieved, we refer to #3203.
Although the feature on it’s own shouldn’t cause trouble, be aware that if the Axon Framework application you are working on already exposes MessageHandlerInterceptors and MessageDispatchInterceptors beans in the Spring Application Context. When this is the case, in combination with custom code to wire these beans into your infrastructure components, the chance is high they’ll be registered twice due to the aforementioned feature.
As such, we recommend to either:
Remove the custom interceptor auto-configuration, to pass along this task to Axon Framework, or
Exclude the InterceptorAutoConfiguration from your Spring Boot auto-configuration.
By following either road, you should be ascertained that interceptors are not registered twice.