[rabbitmq-discuss] Custom Routing?

Bill Wannamaker bill.wannamaker at gmail.com
Fri Feb 11 08:47:08 GMT 2011


Folks,

I'm new to AMQP and RabbitMQ and had some questions about how I should
go about modeling the following problem with exchanges and queues:

A. I have consumers with a routing tag (not unique -- multiple
   consumers may have the same routing tag)

B. Messages are enqueued with a routing tag.

C. Each message should be delivered only once to a consumer among the
   set of consumers for which the function

      canConsume?(consumerRoutingTag, messageRoutingTag)*

   is true.

* canConsume?(aTag, msgTag) = ((aTag & msgTag) == msgTag)


How do I go about configuring my exchange and queues? Do I...

1. Create a queue for each consumer and create a rabbit_exchange_type
   that only delivers to a queue for which canConsumer? is true

2. Create a queue for each consumerRoutingTag (multiple consumers can
   end up on the same queue) and create a rabbit_exchange_type that
   only delivers to a queue for which canConsumer? is true

3. Have a single queue and then somehow scan each consumer for which
   canConsumer? is true for each incoming message and then deliver to
   that consumer?


I would appreciate any guidance here on how to route messages most
effectively to consumers given the above scenario. Further, if I write
my own rabbit_exchange_type, is there support in RabbitMQ for helping
me fairly distribute messages across the candidate lists? Would the
rabbit_exchange_type be the same as

https://github.com/rabbitmq/rabbitmq-external-exchange

Thanks a bunch!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110211/290c22e5/attachment.htm>


More information about the rabbitmq-discuss mailing list