Saga Configuration with AMQ-RabbitMQ

Hi ,
Can you guide me in setting my saga with SpringAMQP as my event Processor. Currently. using RabbitMq for event Bus.

Kind. Regards
Annbuvel

Hi Annbuvel,

Luckily the Reference Guide has a couple of pages on these concepts.

As the Spring AMQP page explains, when you’re using RabbitMq to receive events you will have to set up a SubscribableMessageSource.
To configure this as the message source for a Saga, you will have to specify it as a message source for the Event Processor servicing the Saga.

To do that you can either follow a property file approach as is pointed out at the end of the Spring AMQP page, which comes down to:

  1. Set up a SubscribableMessageSource for your RabbitMq
  2. Specify a Processing Group (through the @ProcessingGroup annotation) on your Saga
  3. Define the Event Processor to be Subscribing like so, axon.eventhandling.processors.{processing-group-name}.mode=subscribing
  4. Define the message source of the Event Processor like so, axon.eventhandling.processors.{processing-group-name}.source={subscribable-message-source-bean-name}
    If you prefer Java configuration over property files, I suggest you to use the following method in your Configuration file:
    EventProcessingConfigurer#registerSubscribingEventProcessor(String, Function<Configuration, SubscribableMessageSource<? extends EventMessage<?>>>)

Hope this clears up some things for you Annbuvel.

Cheers,
Steven