[openamq-dev] round-robin queues
Esteve Fernandez
esteve at sindominio.net
Sat Feb 9 13:23:12 CET 2008
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.
More information about the openamq-dev
mailing list