[rabbitmq-discuss] Exchange/queue setup question
Chris Johnson
wchrisjohnson at gmail.com
Mon Aug 20 17:10:58 BST 2012
I need a second pair of eyes on a small RMQ app I'm working on.
I suspect the issue I'm seeing is related to how I am defining my exchanges
and queues.
If I connect with two clients, I'll see every other message appear on my
client. If I connect with three clients, I see every third message, and so
on. In other words, it appears to 1) be deleting every message that gets
produced on consumption, and 2) round robins which consumer gets each
message.
What I want to see is all clients get the same message each time one is
posted.
Is a topic approach the best approach for this, or is fanout the better way
to handle this?
Here's the specifics of how my producer and consumer is set up:
PRODUCER (client=bunny)
=====================
@topic_exchange ||= client.exchange("internal.platformalert", :type =>
:topic,
:durable => true, :autodelete => false)
@queue ||= client.queue("internal.platformalert.#", :durable => true,
:autodelete => false, :arguments => {'x-ha-policy'
=> 'all'})
queue.bind(e, :key => "alert")
exchange.publish(message, :key => "alert", :persistent => true)
CONSUMER (client=ruby-amqp)
=====================
exchange = channel.topic("internal.platformalert", :durable => true,
:autodelete => false)
queue = channel.queue("internal.platformalert.#", :durable => true,
:autodelete => false,
:arguments => {'x-ha-policy' => 'all'})
queue.bind(exchange, :routing_key => "alert")
queue.subscribe(:ack => false) do |header, body|
do stuff
end
Many thanks!
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120820/6b52062a/attachment.htm>
More information about the rabbitmq-discuss
mailing list