[openamq-dev] round-robin queues

Martin Sustrik sustrik at imatix.com
Sat Feb 9 13:47:05 CET 2008


Esteve,

The solution with multiple queues is the correct one. And yes, the queue 
creation is cheap. You can have thousands of them with no problems. 
However, if the number gets to the order of hundreds of thousands or 
millions, it can cause problems. What number of "categories" (like book, 
magazine, etc.) do you expect to have?

Martin

Esteve Fernandez wrote:
> Hi all, is there way to dispatch messages only once if two queues are bound to 
> the same exchange with similar arguments? I guess it's easier to develop this 
> question with an example scenario:
>
> - a headers exchange "library"
> - A, B and C are different boxes, each having a consumer and a queue bound 
> to "library" with similar (but different) arguments:
>
> * A has a queue bound to "library" twice with the following headers:
> o type: magazine
> o type: book
>
> * B has a queue bound to "library" twice with the following headers:
> o type: book
> o type: dvd
>
> * C has a queue bound to "library" twice with the following headers:
> o type: dvd
> o type: magazine
>
> when, for example, a message with "type: magazine" is sent to "library", both 
> A and C receive them, as expected. Is there a routing scheme that allows to 
> do round-robin at the queue level, not at the consumer level? That is, if 
> such message is sent, either A or C receives it, but not both.
>
> The other approach that I came up with is to have a queue for each type 
> (magazine, book and dvd), the problem is that I might end up having a lot of 
> queues if I add more types. When Pieter responded to Terry, he said that 
> queue creation is cheap, but that creating so many queues might be slower 
> than having one queue per client.
>
> Cheers.
> _______________________________________________
> openamq-dev mailing list
> openamq-dev at lists.openamq.org
> http://lists.openamq.org/mailman/listinfo/openamq-dev
>   



More information about the openamq-dev mailing list