[rabbitmq-discuss] Problem with multiple subscribers on the same queue

Ben Hood 0x6e6562 at gmail.com
Mon Aug 24 15:15:13 BST 2009


Frank,

On 8/24/09, Ben Hood <ben at lshift.net> wrote:
>
> Thanks for this answer. The second solution is the one I have already
> chosen (found it few hours after having written you my mail). But to be
> honest, I am not very happy with that because it introduces some
> potential failures on my system. For example, to publishers (the one
> listening for subscription on marketdata.test#RPC in my previous
> example) will be able to listen to the same subject (let's say TOTO.#
> for example) and if a subscriber come and ask for a subscription on
> TOTO.test1 (request is made through the marketdata.test#RPC exchange as
> you can imagine), both of them will take it in account and will publish
> data for TOTO.test1.
> Anyway, I have no choice for the moment so I will handle that.

So if I understand you correctly, you want messages to be consumed
selectively but only once, i.e. only by one single consumer who
decides that they are capable of processing that message type?

So if that is the case, can't you use a topic exchange to only make
exact matches - i.e. when you construct your routing table, you just
make sure that you don't have bindings that cause a message to be
multicasted to more that one queue? Or as an alternative, since the
message type is a discriminating factor, why not make it out to be a
first class endpoint and send each different message type directly to
a well-known queue whose consumers only process that message type?

My original point was that you probably shouldn't being using message
rejection (if it were available) to do a selective receive. Selective
reception belongs *ideally* in the routing layer and message rejection
should generally only used as neat and tidy way to handle
unforeseeable exceptions.

Maybe I am missing the point though.

> Yes of course you can put this topic onto the publish discussion forum
> (to be honest, I was thinking that I was writing to the public RabbitMQ
> mailing list throught the info at rabbitmq email).

OK, I've now taken this discussion onto the public forum, please just
CC rabbitmq-discuss at lists.rabbitmq.com

HTH,

Ben




More information about the rabbitmq-discuss mailing list