You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Birdsall, Dave" <da...@hp.com> on 2011/01/13 19:54:58 UTC

Maps and filtering

Hi,

I'm looking at the Variant::Map / encode / decode facility for serializing data content into a qpid message.

Is there any integration between this serialization and subscription facilities in the broker?

For example, suppose I have encoded a message using the program described at https://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/examples/messaging/map_sender.cpp.

Is there a way for a subscriber to tell the broker it only wants messages where the "name" field has the value "Widget"?

Thanks and kind regards,

Dave Birdsall
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Maps and filtering

Posted by Alan Conway <ac...@redhat.com>.
On 01/18/2011 04:17 PM, Jonathan Robie wrote:
> On 01/17/2011 10:37 AM, Alan Conway wrote:
>> On 01/13/2011 04:54 PM, Jonathan Robie wrote:
>>> Content-based filtering is currently available only for XML messages,
>>> using the XML Exchange.
>>>
>>> There's no reason the same functionality couldn't be extended to maps,
>>> but nobody has implemented that.
>>
>> There is also the amq.headers exchange which will let you do simple
>> filtering on the application headers set on a message.
>
> So with the current broker, the options are:
>
> 1. Serialize to XML instead of maps, and query using the XML exchange.
> 2. Extract the values you want to query, put them in headers, and query using
> the headers exchange.
> 3. Extract the values you want to query, put them in headers, and query using
> the XML Exchange. The message doesn't have to be in XML to do this, if the query
> uses only the headers, it does not attempt to parse the message as XML.
>

That sounds like something to go in the docs under "how-to filter"

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Maps and filtering

Posted by Jonathan Robie <jo...@redhat.com>.
On 01/17/2011 10:37 AM, Alan Conway wrote:
> On 01/13/2011 04:54 PM, Jonathan Robie wrote:
>> Content-based filtering is currently available only for XML messages,
>> using the XML Exchange.
>>
>> There's no reason the same functionality couldn't be extended to maps,
>> but nobody has implemented that.
>
> There is also the amq.headers exchange which will let you do simple
> filtering on the application headers set on a message.

So with the current broker, the options are:

1. Serialize to XML instead of maps, and query using the XML exchange.
2. Extract the values you want to query, put them in headers, and query 
using the headers exchange.
3. Extract the values you want to query, put them in headers, and query 
using the XML Exchange. The message doesn't have to be in XML to do 
this, if the query uses only the headers, it does not attempt to parse 
the message as XML.

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Maps and filtering

Posted by Alan Conway <ac...@redhat.com>.
On 01/13/2011 04:54 PM, Jonathan Robie wrote:
> Content-based filtering is currently available only for XML messages, using the
> XML Exchange.
>
> There's no reason the same functionality couldn't be extended to maps, but
> nobody has implemented that.
>

There is also the amq.headers exchange which will let you do simple filtering on 
the application headers set on a message.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Maps and filtering

Posted by Jonathan Robie <jo...@redhat.com>.
Content-based filtering is currently available only for XML messages, 
using the XML Exchange.

There's no reason the same functionality couldn't be extended to maps, 
but nobody has implemented that.

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org