diff --git a/distributed-exceptions/src/main/java/io/axoniq/distributedexceptions/command/AxonCommandConfiguration.java b/distributed-exceptions/src/main/java/io/axoniq/distributedexceptions/command/AxonCommandConfiguration.java deleted file mode 100644 index 973519b2..00000000 --- a/distributed-exceptions/src/main/java/io/axoniq/distributedexceptions/command/AxonCommandConfiguration.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.axoniq.distributedexceptions.command; - -import org.axonframework.commandhandling.CommandBus; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Profile("command") -@Configuration -public class AxonCommandConfiguration { - - @Autowired - void commandBus(CommandBus commandBus, ExceptionWrappingHandlerInterceptor exceptionWrappingHandlerInterceptor) { - //noinspection resource - commandBus.registerHandlerInterceptor(exceptionWrappingHandlerInterceptor); - } -} diff --git a/subscription-query-streaming/src/main/java/io/axoniq/dev/samples/AxonConfig.java b/subscription-query-streaming/src/main/java/io/axoniq/dev/samples/AxonConfig.java index 6c981511..e9af7066 100644 --- a/subscription-query-streaming/src/main/java/io/axoniq/dev/samples/AxonConfig.java +++ b/subscription-query-streaming/src/main/java/io/axoniq/dev/samples/AxonConfig.java @@ -1,8 +1,7 @@ package io.axoniq.dev.samples; -import org.axonframework.config.ConfigurerModule; +import org.axonframework.commandhandling.gateway.CommandGateway; import org.axonframework.eventhandling.gateway.EventGateway; -import org.axonframework.lifecycle.Phase; import org.axonframework.messaging.Message; import org.axonframework.messaging.interceptors.LoggingInterceptor; import org.axonframework.queryhandling.QueryGateway; @@ -10,7 +9,7 @@ import org.springframework.context.annotation.Configuration; /** - * Basic Axon configuration adding the {@link LoggingInterceptor} to the {@link QueryGateway} and {@link EventGateway}. + * Basic Axon configuration adding the {@link LoggingInterceptor} to the {@link CommandGateway}, {@link QueryGateway} and {@link EventGateway}. * This provides easy logging of all the messages being published, ensuring that portion of the application works. * * @author Steven van Beelen @@ -23,12 +22,4 @@ public LoggingInterceptor> loggingInterceptor() { return new LoggingInterceptor<>(); } - @SuppressWarnings("resource") - @Bean - public ConfigurerModule loggingInterceptorConfigurerModule(LoggingInterceptor> loggingInterceptor) { - return configurer -> configurer.onInitialize(config -> config.onStart(Phase.OUTBOUND_QUERY_CONNECTORS, () -> { - config.eventGateway().registerDispatchInterceptor(loggingInterceptor); - config.queryGateway().registerDispatchInterceptor(loggingInterceptor); - })); - } }