Hi,
I’m migrating our microservices from Axon 3 to Axon 4 and have a problem with configuring our sagas to be able to read events directly from AMQP queues. All of our sagas are annotation based (using @Saga).
In Axon 3 we have following configuration to achieve this:
@Bean public SagaConfiguration<MySaga> mySagaConfig(SpringAmqpMessageSource externalEventsMessageSource) { return SagaConfiguration.subscribingSagaManager(MySaga.class, c -> externalEventsMessageSource); }
Additionally, our event processing is also configured with this additional messages source:
@Autowired public void configureEventProcessing(EventProcessingConfigurer eventProcessingConfigurer, SpringAmqpMessageSource externalEventsMessageSource) { eventProcessingConfigurer.registerSubscribingEventProcessor(EXTERNAL_EVENTS_PROCESSOR_NAME, c -> externalEventsMessageSource); eventProcessingConfigurer.usingSubscribingEventProcessors(); // override default logging error handler for event listeners eventProcessingConfigurer.registerDefaultListenerInvocationErrorHandler(configuration -> PropagatingErrorHandler.instance()); }
However I cannot figure out how can I do this in Axon 4 and still rely on auto configuration based on @Saga annotation. Is it possible?
I’ll be very grateful for some guidance.
Cheers,
Tomek