Spring Boot java configuration for Spring AMQP Terminal

Hi,

Can anyone please help on what needs to configure in a spring boot application( with java configuration) an event bus with ActiveMQ and AMQP Terminal?
I want to use ActiveMQ to send messages to different JVM.I have to use Clustering Event Bus and Spring AMQP Terminal to do that, it’s correct?

Thanks,
Filippo

Hi Filippo,

yes, that’s correct. The ClusteringEventBus just organizes the event handlers into “Clusters”. Each cluster can have certain properties regarding transactions, or in the case of the Spring AMQP Terminal, also a queue that they read from. Basically, a single cluster will become a single reader from a queue and pass each message to all the handlers assigned to that cluster instance.

One of the configuration files of a test case provides a pretty good sample on how to configure AMQP:
https://github.com/AxonFramework/AxonFramework/blob/axon-2.4.x/amqp/src/test/resources/META-INF/spring/messaging-context.xml

It contains a mix of Spring configuration (to ensure queues and exchanges are set up) as well as Cluster and Terminal configuration.

By default, the queue that a Cluster listens to is the queue that has the same name as the terminal. In the Cluster, you can provide configuration to override that behavior and set Cluster-specific properties.

Hope this help.
Cheers,

Allard

Thanks!