[rabbitmq-discuss] the select messages by routing-key

Alexis Richardson alexis.richardson at gmail.com
Wed Oct 7 11:38:40 BST 2009


Alexandre

2009/10/7 Alexandre Kalendarev <akalend at mail.ru>:
> Alexis,
>
> It is second path.

Understood.


> First path:  I have million users, million queues.
> Second path: I will to have two-five million queues.

In RabbitMQ:

* the messages are stored efficiently i.e. the same message, even if
in two queues, is only stored once per node
* the queues take up some (small) space
* the bindings take up space

So in fact there is little difference between one queue with two
bindings, and two queues with one binding each.  As the number of
bindings grows relative to the number of queues, the difference
between your 'path one' and 'path two' decreases monotonically towards
zero.  (All other things being equal).

Does this help?

alexis






>
>
>>
>> To achieve this you need two queues and one exchange.
>>
>> Bind queue 1 to the exchange with key 'news'.
>> Bind queue 2 to the exchange with key 'realty'.
>>
>> To see messages with key 'news', consume from queue 1.
>> To see messages with key 'realty', consume from queue 2.
>>
>> alexis
>>
>>
>>
>>
>>
>> On Wed, Oct 7, 2009 at 9:37 AM, Alexandre Kalendarev <akalend at mail.ru> wrote:
>> > Hi All,
>> >
>> > I have the received messages into the queue with routing-key:
>> > message #1  - key: news
>> > message #2  - key: realty
>> > message #3  - key: realty
>> > message #4  - key: news
>> >
>> > Can I to read from queue only by single routing-key, for example:
>> > only first reading block
>> > message #2  - key: realty
>> > message #3  - key: realty
>> >
>> > only Second reading block:
>> > message #1  - key: news
>> > message #4  - key: news
>> >
>> >
>> > I see next path:
>> > - read all messages with no_ack (basic.get )
>> > - filtring by key
>> >
>> > read second block:
>> > - read all messages (basic.get )
>> > - filtring by second key
>> >
>> > Lack of this method is duble the incoming flow
>> >
>> > The second path is to have the two different queues.
>> >
>> >
>> > thanks
>> >
>> >
>> >
>> > Alexandre
>> >
>> > _______________________________________________
>> > rabbitmq-discuss mailing list
>> > rabbitmq-discuss at lists.rabbitmq.com
>> > http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>> >
>>
>




More information about the rabbitmq-discuss mailing list