Try registering the dispatching interceptor directly on EventBus instead of EventGateway.
Didn’t understand a second issue, but if you are trying to apply the interceptor to subscription query, this is possible with latest Axon Framework release: 4.4.1
I thought I tried this already with no success. I can give it a 2nd try.
The 2nd one is the major problem. If I register like described my normal query works.
BUT the subscription queries do then all timeout. I don’t need the interceptor at subscription queries as this is only the “return” value.
I need to pass my additional data for normal queries only. Is there a way to register the interceptor only for normal queries and not for subscription queries?
public EventBus configureEventBus(EventStorageEngine eventStorageEngine) {
// note that an EventStore is a more specific implementation of an EventBus
EventBus eventBus = EmbeddedEventStore.builder()
.storageEngine(eventStorageEngine)
.build();
eventBus.registerDispatchInterceptor(new LocaleEventDispatchInterceptor());
return eventBus;
}
example. If I add a @Bean there I only get a
Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type ‘org.axonframework.eventhandling.EventBus’ available: expected single matching bean but found 2: configureEventBus,eventStore
I think it is a really simple fix. I simply don’t see it right now…
The following candidates were found but could not be injected:
Bean method ‘eventStorageEngine’ in ‘JdbcAutoConfiguration’ not loaded because @ConditionalOnMissingBean (types: org.axonframework.eventsourcing.eventstore.EventStorageEngine,org.axonframework.eventhandling.EventBus; SearchStrategy: all) found beans of type ‘org.axonframework.eventhandling.EventBus’ eventStore, configureEventBus
Bean method ‘eventStorageEngine’ in ‘JpaEventStoreAutoConfiguration’ not loaded because @ConditionalOnMissingBean (types: org.axonframework.eventsourcing.eventstore.EventStorageEngine,org.axonframework.eventhandling.EventBus; SearchStrategy: all) found beans of type ‘org.axonframework.eventhandling.EventBus’ eventStore, configureEventBus