Related dev.to article.
This is an example using two JMS servers in the same Spring Boot Application.
To run this example you need to start two instaces of IBM MQ, with QM1 and QM2:
./qm1_start.sh
./qm2_start.sh
mvn clean install
Execute consumer.
./consumer.sh
Open two producers, each one in its own terminal:
# Uses QM1
./producer1.sh
# Uses QM2
./producer2.sh
Type anything and it will be sent to the queue.
Execute the dynamice version os the consumer instead.
./dynamic-consumer.sh