[rabbitmq-discuss] Custom Routing?
James Carr
james.r.carr at gmail.com
Sun Feb 13 21:18:09 GMT 2011
I gave a rabbitMQ presentation recently and thought my solution to
"custom" routing was a pretty good approach. Essentially it takes
advantage of the DynamicRouter pattern from EIP. A consumer decides it
wants to be notified of data that meets a certain criteria beyond what
one can accomplish with routing keys and sends a command message that
contains that criteria and a routing key it'd like messages that meet
that criteria to be published on. On the publish side it evaluates
each message using the criteria and publishes any matches.
Just thought I'd point it out in case it might be helpful.
Thanks,
James
On Fri, Feb 11, 2011 at 3:47 AM, Bill Wannamaker
<bill.wannamaker at gmail.com> wrote:
> 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!
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
More information about the rabbitmq-discuss
mailing list