[rabbitmq-discuss] Dynamic queue problem

Bhaskar teja prudhviy at gmail.com
Mon Sep 10 20:27:00 BST 2012


Thank you,

Please let me know if the following design pattern is good enough,

Producer:
  Exchange name - "event-notifications"
  Type - topic
  Routing key - "mail.mobile.web.documents"

Consumer  for web notifications:
  Exchange name - "event-notifications"
  Type - topic
  Routing key - "#.web.documents"
  Queue name - "web_notifications"

Consumer  for mobile notifications:
  Exchange name - "event-notifications"
  Type - topic
  Routing key - "#.mobile.#.documents"
  Queue name - "mobile_notifications"

Consumer  for mail notifications:
  Exchange name - "event-notifications"
  Type - topic
  Routing key - "mail.#.documents"
  Queue name - "mail_notifications"


On 9/11/12, Francesco Mazzoli <francesco at rabbitmq.com> wrote:
>
> Please be aware of Matthias' corrections to my post:
> <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2012-September/022394.html>
>
> At Mon, 10 Sep 2012 23:53:42 +0530,
> Bhaskar teja wrote:
>> We have 20 different kinds of web notifications. we categorized them into
>> 5 *
>> 4 and gave a routing key for each kind like -- documents
>>                                           -- wall
>>                                           -- issues
>>                                           -- tasks
>> each having 5 notifications of its kind. we have plans to make rabbitmq
>> handle
>> e-mails via consumers. In future we thought of having topic exchanges so
>> that
>> single event message from web app to rabbitmq can route the messages
>> appropriately like,
>>   --- web_notifs.documents
>>   --- mail.documents
>>   --- logging.documents
>> so we declared dynamic queues so that routing keys match via *.documents.
>> Is there a better way to design this with named queues, so that we can run
>> a
>> single consumer for now?
>
> Can't you just name it `all-documents' or something like that?
>
>> How can i get the old dynamic queue name? I could not find any api in
>> python
>> pika module.
>
> I think that you have to pass a callback to the `queue_declare' function,
> but
> the docs are unclear on the subject.
>
> --
> Francesco * Often in error, never in doubt
>


-- 
Thank you,
Bhaskar teja


More information about the rabbitmq-discuss mailing list