This is a small sample of how to consume, using QPID, from different threads in a multicast address on a Red AMQ 7 broker. Use it as reference for your own implementation.
-
Edit the
src/main/resources/jndi.properties
file and add your broker credentials to it. -
Create a multicast address in your
broker.xml
file.
<address name="exampleTopic">
<multicast/>
</address>
-
Run the
Consumer1.java
andConsumer2.java
to create consumers that will listen for messages on the topic. -
Run the
Producer.java
. A message must be sent to the topic and one of the consumers should consume it. -
Alternatively, comment line
32
and uncomment line33
in classProducer.java
. -
Run the
Producer.java
again. A message must be sent to the topic and the another consumer should consume it.