Class InterceptorAutoConfiguration
java.lang.Object
org.axonframework.springboot.autoconfig.InterceptorAutoConfiguration
@AutoConfiguration
@ConditionalOnClass(SpringConfigurer.class)
@AutoConfigureAfter({AxonAutoConfiguration.class,JpaAutoConfiguration.class,JpaEventStoreAutoConfiguration.class,NoOpTransactionAutoConfiguration.class,TransactionAutoConfiguration.class})
public class InterceptorAutoConfiguration
extends Object
Interceptor autoconfiguration class for Axon Framework application. Discovers
MessageHandlerInterceptors and
MessageDispatchInterceptor and registers them with the respective buses and gateways.
Note: This class use a hack approach! Because some gateways/buses (or custom interceptors provided by the framework user) need an axonConfiguration to initialize, the usual way of registering interceptors in the ConfigurerModule.onInitialize method does not work for them. This is due to a circular reference caused e.g. by JpaJavaxEventStoreAutoConfiguration. So we register them by injecting gateway/bus components in to the InitializingBean function and register the interceptors there.
- Since:
- 4.11.0
- Author:
- Christian Thiel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.beans.factory.InitializingBeancommandDispatchInterceptorConfigurer(CommandGateway commandGateway, Optional<List<MessageDispatchInterceptor<? super CommandMessage<?>>>> interceptors) org.springframework.beans.factory.InitializingBeancommandHandlerInterceptorConfigurer(CommandBus commandBus, Optional<List<MessageHandlerInterceptor<? super CommandMessage<?>>>> interceptors) org.springframework.beans.factory.InitializingBeaneventDispatchInterceptorConfigurer(EventGateway eventGateway, Optional<List<MessageDispatchInterceptor<? super EventMessage<?>>>> interceptors) org.springframework.beans.factory.InitializingBeanmessageHandlerInterceptorConfigurer(EventProcessingConfigurer eventProcessingConfigurer, Optional<List<MessageHandlerInterceptor<? super EventMessage<?>>>> interceptors) org.springframework.beans.factory.InitializingBeanqueryDispatchInterceptorConfigurer(QueryGateway queryGateway, Optional<List<MessageDispatchInterceptor<? super QueryMessage<?, ?>>>> interceptors) org.springframework.beans.factory.InitializingBeanqueryHandlerInterceptorConfigurer(QueryBus queryBus, Optional<List<MessageHandlerInterceptor<? super QueryMessage<?, ?>>>> interceptors)
-
Constructor Details
-
InterceptorAutoConfiguration
public InterceptorAutoConfiguration()
-
-
Method Details
-
commandDispatchInterceptorConfigurer
@Bean @ConditionalOnBean(MessageDispatchInterceptor.class) public org.springframework.beans.factory.InitializingBean commandDispatchInterceptorConfigurer(CommandGateway commandGateway, Optional<List<MessageDispatchInterceptor<? super CommandMessage<?>>>> interceptors) -
eventDispatchInterceptorConfigurer
@Bean @ConditionalOnBean(MessageDispatchInterceptor.class) public org.springframework.beans.factory.InitializingBean eventDispatchInterceptorConfigurer(EventGateway eventGateway, Optional<List<MessageDispatchInterceptor<? super EventMessage<?>>>> interceptors) -
queryDispatchInterceptorConfigurer
@Bean @ConditionalOnBean(MessageDispatchInterceptor.class) public org.springframework.beans.factory.InitializingBean queryDispatchInterceptorConfigurer(QueryGateway queryGateway, Optional<List<MessageDispatchInterceptor<? super QueryMessage<?, ?>>>> interceptors) -
commandHandlerInterceptorConfigurer
@Bean @ConditionalOnBean(MessageHandlerInterceptor.class) public org.springframework.beans.factory.InitializingBean commandHandlerInterceptorConfigurer(CommandBus commandBus, Optional<List<MessageHandlerInterceptor<? super CommandMessage<?>>>> interceptors) -
queryHandlerInterceptorConfigurer
@Bean @ConditionalOnBean(MessageHandlerInterceptor.class) public org.springframework.beans.factory.InitializingBean queryHandlerInterceptorConfigurer(QueryBus queryBus, Optional<List<MessageHandlerInterceptor<? super QueryMessage<?, ?>>>> interceptors) -
messageHandlerInterceptorConfigurer
@Bean public org.springframework.beans.factory.InitializingBean messageHandlerInterceptorConfigurer(EventProcessingConfigurer eventProcessingConfigurer, Optional<List<MessageHandlerInterceptor<? super EventMessage<?>>>> interceptors)
-