Reputation: 93
RabbitMQ is sending a message to two instances of the same app, instead of one. The messages are not being published in a round robin manner. I am using the Java client. Not sure what am doing wrong.
This is how I set it up.
Channel channel = connection.createChannel();
channel.exchangeDeclare("exchange_name", "topic");
channel.basicPublish("exchange_name", "binding.key",
MessageProperties.PERSISTENT_TEXT_PLAIN,
message.getBytes());
channel.close();
Upvotes: 0
Views: 641
Reputation: 36
To achieve round-robin, every producer and consumer should declare a named queue, and everyone should use the same queue name.
Messages will be published in a round-robin manner to every consumer looking at the same queue.
Upvotes: 2