qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siamak Kolahi <siamak.kol...@gmail.com>
Subject Re: Multiple Headers with the same key
Date Wed, 07 Apr 2010 14:45:49 GMT
I tried doing so (binding same channel multiple times with different
values). but it doesnt work out. It only receives messages matching the last
value binded to.

Thanks,
Siamak

On Tue, Apr 6, 2010 at 11:55 AM, Gordon Sim <gsim@redhat.com> wrote:

> On 04/05/2010 09:22 PM, Siamak Kolahi wrote:
>
>> Hi guys,
>>
>> I have got a problem with the Headers exchange. The problem is that I want
>> to subscribe to multiple headers in a headers exchange, with same key and
>> different values per say, and receive messages for all messages matching
>> ANY
>> of those values. say I want to subscribe to a channel and receive all
>> messages with headers named 'foo' with either values of a or b. would such
>> subscription be possible in qpid? or I need to handle this complexity at
>> own
>> end?
>>
>
> One simple way is simply to bind your subscription queue multiple times,
> once for each valid value. You should then get any message that matches at
> least one of those bindings.
>
>
>  I can understand why such logic wont make sense for ALL case because the
>> header should match one of them anyway. But for the ANY case, it would
>> improve the performance and complexity for me if I would be able to do so.
>> So I was wondering if this is by design?
>>
>> I know in Python client per say, arguments are passed to exchange using a
>> dictionary, eliminating such flexibility right off the bet (no multiple
>> entries with same key in Python dicts). Also as I see in C++ broker,
>> headers
>> are handled using a mapping dictionary, again removing such possibility.
>>
>> So is there any thoughts on such scenario? is it by design or by spec
>> resulted in such implementation? (cant find anything in AMQP spec
>> regarding
>> that)
>>
>
> As far as I recall the spec states that maps with duplicate keys are not
> valid and lead to unpredictable behaviour. In qpid I believe none of the
> clients or brokers will send such maps/field-tables.
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message