I can create a fan exchange using the Publish / Sign RabbitMQ Java tutorial, and any connected consumer will receive a copy of the message. Instead of declaring the exchange and binding dynamically / programmatically, I would like to create an exchange and binding before connecting all consumers. I did this through the RabbitMQ management console. For some reason, however, my consumers receive messages in a cyclical mode, and not all receiving copies of the message. What am I missing? Here are some code snippets:
Publisher:
channel.basicPublish("public", "", null, rowId.getBytes("UTF-8"));
Consumer:
QueueingConsumer consumer = new QueueingConsumer(channel); channel.basicConsume("myqueue", false, consumer);
... And in the RabbitMQ management console, I created a "public" exchange like "fanout", and I set the binding from this exchange to "myqueue".
I would be grateful for any help!
source share