I am able to create a fanout exchange using the Publish/Subscribe RabbitMQ Java tutorial, and any connected consumer will receive a copy of a message. Instead of declaring an exchange and binding dynamically/programmatically, I would like to create the exchange and the binding prior to connecting any consumers. I have done this through the RabbitMQ Management Console. For some reason, however, my consumers are receiving messages in a round-robin fashion, rather than 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 an exchange "public" of type "fanout", and I set a binding from that exchange to "myqueue".
I'd appreciate any help!