Flexible routing keys for topic exchange

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Flexible routing keys for topic exchange

Rom Cabral
Hi guys,

I would like to hear any suggestions to be able to design flexible routing keys. Below is my use case.

If I have 3 queues A, B, C connected to an exchange, I would like to
- send message to A,B,C (broadcast)
- send to any combination AB, BC, AC
- send only to A, B, C

I can accomplish this by assigning key for each combination. Unfortunately, it will grow as the number of queues grow. What i want is to "*" and "#" in my design.

Thanks,


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Flexible routing keys for topic exchange

Alvaro Videla-2
Hi,

If you want to decide to which queues to send the message, but at publishing time, then you might want to use the 'reverse topic exchange'

See more details on how to obtain the plugin here: http://www.rabbitmq.com/community-plugins.html The plugin is called 'rabbitmq_rtopic_exchange' and also please carefully read the performance details explained here https://github.com/videlalvaro/rabbitmq-rtopic-exchange#performance

Regards,

Alvaro


On Thu, Jun 19, 2014 at 10:17 AM, Rom Cabral <[hidden email]> wrote:
Hi guys,

I would like to hear any suggestions to be able to design flexible routing keys. Below is my use case.

If I have 3 queues A, B, C connected to an exchange, I would like to
- send message to A,B,C (broadcast)
- send to any combination AB, BC, AC
- send only to A, B, C

I can accomplish this by assigning key for each combination. Unfortunately, it will grow as the number of queues grow. What i want is to "*" and "#" in my design.

Thanks,


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Flexible routing keys for topic exchange

Michael Klishin-2
In reply to this post by Rom Cabral
 On 19 June 2014 at 12:19:29, Rom Cabral ([hidden email]) wrote:
> > - send message to A,B,C (broadcast)

use a fanout

> - send to any combination AB, BC, AC

when a new queue is added, you'll have to list them in a consumer (or whatever app
declares them) and create multiple bindings, say

a.*, b.* and so on

> - send only to A, B, C

use the default exchange.

Topic exchange patterns cannot offer arbitrary permutations in (2) and are less than optimal
for (1) and (3).
--  
MK  

Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Flexible routing keys for topic exchange

Michael Klishin-2
On 19 June 2014 at 12:30:06, Michael Klishin ([hidden email]) wrote:
> > Topic exchange patterns cannot offer arbitrary permutations  
> in (2

…without some effort on the application side, e.g. when new queues that need to
be permutated are created, that is 
--  
MK  

Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Flexible routing keys for topic exchange

Matthias Radestock-3
In reply to this post by Michael Klishin-2
On 19/06/14 09:28, Michael Klishin wrote:
> On 19 June 2014 at 12:19:29, Rom Cabral ([hidden email])
>> - send to any combination AB, BC, AC
>
> when a new queue is added, you'll have to list them in a consumer (or
> whatever app declares them) and create multiple bindings, say
>
> a.*, b.* and so on

better: take advantage of http://www.rabbitmq.com/sender-selected.html,
and use the default exchange.

Matthias.
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss