Axon 4 - reading events directly from AMQP source in Saga

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

Hi Tomek,

The above is definitely still doable, but one of the major changes performed between Axon 3 and 4 was the migration of all extensions into their own dedicated repositories.
As such, the Axon AMQP Extension can now be found here.
By adding the axon-amqp-spring-boot-starter dependency next to the axon-spring-boot-starter dependency should be sufficient.

Hope this helps you out Tomek!

Cheers,
Steven