Skip to content

Commit 826f099

Browse files
fix(axon-spring-boot-autoconfigure): do not duplicate interceptor registration (#427)
1 parent 36ff72e commit 826f099

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

distributed-exceptions/src/main/java/io/axoniq/distributedexceptions/command/AxonCommandConfiguration.java

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
package io.axoniq.dev.samples;
22

3-
import org.axonframework.config.ConfigurerModule;
3+
import org.axonframework.commandhandling.gateway.CommandGateway;
44
import org.axonframework.eventhandling.gateway.EventGateway;
5-
import org.axonframework.lifecycle.Phase;
65
import org.axonframework.messaging.Message;
76
import org.axonframework.messaging.interceptors.LoggingInterceptor;
87
import org.axonframework.queryhandling.QueryGateway;
98
import org.springframework.context.annotation.Bean;
109
import org.springframework.context.annotation.Configuration;
1110

1211
/**
13-
* Basic Axon configuration adding the {@link LoggingInterceptor} to the {@link QueryGateway} and {@link EventGateway}.
12+
* Basic Axon configuration adding the {@link LoggingInterceptor} to the {@link CommandGateway}, {@link QueryGateway} and {@link EventGateway}.
1413
* This provides easy logging of all the messages being published, ensuring that portion of the application works.
1514
*
1615
* @author Steven van Beelen
@@ -23,12 +22,4 @@ public LoggingInterceptor<Message<?>> loggingInterceptor() {
2322
return new LoggingInterceptor<>();
2423
}
2524

26-
@SuppressWarnings("resource")
27-
@Bean
28-
public ConfigurerModule loggingInterceptorConfigurerModule(LoggingInterceptor<Message<?>> loggingInterceptor) {
29-
return configurer -> configurer.onInitialize(config -> config.onStart(Phase.OUTBOUND_QUERY_CONNECTORS, () -> {
30-
config.eventGateway().registerDispatchInterceptor(loggingInterceptor);
31-
config.queryGateway().registerDispatchInterceptor(loggingInterceptor);
32-
}));
33-
}
3425
}

0 commit comments

Comments
 (0)