[rabbitmq-discuss] help - design pattern for an our use case

Emile Joubert emile at rabbitmq.com
Wed Jul 18 12:23:05 BST 2012


On 18/07/12 06:41, Bhaskar teja wrote:
> What is a good design pattern for our use case - like number of queues?,
> exchange type?, number of exchanges( web, e-mail ) ??

This looks like a potential application of topics and a topic exchange.
Allocate a queue for each user. Bind each user queue with appropriate
routing keys. So a queue for user "alice" belonging to two communities
might have these bindings:


When "alice" takes an action that her communities may be interested in
then a message must be sent to the topic exchange with a routing key for
each of the communities that she belongs to. It is possible to do this
in a single operation using CC routing. See

Depending on the complexity of when groups are notified you could
implement groups as sub-topics, so a group within pet-owners might be:


Depending on the rules for email notifications you could use a
combination of dead letter exchanges and queue-TTL to detect when
notifications have been waiting in the queue for too long and send them
to the user by email. See:


A possible problem with this design is the large number of bindings
involved. This could be slow and difficult to manage, depending on the
branching factor. You could contain the complexity by using
exchange-to-exchange bindings and internal exchanges for groups (and


More information about the rabbitmq-discuss mailing list