[rabbitmq-discuss] Making sure a message gets to every consumer
Sam Duncan
sduncan at wetafx.co.nz
Mon Jan 24 23:06:32 GMT 2011
Does it need to be one queue? If you use a topic exchange and create a
queue for each consumer, you get a copy of each message in each queue
filtered by your queue bindings. You could even have a shared queue for
each consumer type so the messages are not duplicated in context.
Sam
On 25/01/11 12:00, Dan Tenenbaum wrote:
> Hi,
> Still trying to migrate my head over from JMS concepts to RabbitMQ.
>
> I have a situation that I want to be like this:
>
> App1 sends a message to anyone who is listening to a certain queue.
> I want ALL consumers of that queue to get every message sent by App1,
> I don't want it dispatched in a round-robin fashion. At the same time,
> I don't think I want to use a fanout exchange because I don't want all
> consumers in the vhost to get the message, just the ones that are
> subscribed to by instances of:
>
> App2
> There are several instances of App2.
> When App2 gets a message, it does some work and sends progress
> messages back to App1. There is presently only one instance of App1
> but I might like to have other consumers in future for the messages
> that App1 receives.
>
> The problem:
> I can't figure out the right combination of exchange types, queues,
> and routing keys to get this to work.
>
> It seems that if I use either 'direct' or 'topic' as my exchange type,
> the messages that app1 sends are dispatched in a round-robin fashion
> (that is, not all listeners get every message).
>
> If I set the exchange type to fanout, then app2 keeps sending the same
> message back to app1 over and over. It could be that I have created an
> infinite loop of messages back and forth.
>
>
> Anyway....in JMS headspace I would simply have 2 topics, call them
> "fromapp1" and "fromapp2" and subscribe each app to the appropriate
> topic, and it would Just Work....maybe I was doing something wrong
> back then? Certainly I'm doing something wrong now.
>
> If someone can suggest the pattern I might want to use, that would be
> great.
>
> Thanks
> Dan
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110125/882a7b9c/attachment.htm>
More information about the rabbitmq-discuss
mailing list