On 26 June 2013 13:16, Gordon Sim <[email protected]> wrote:

> On 06/26/2013 12:56 PM, Robbie Gemmell wrote:
>
>> I don't have a full answer for this, so I am hoping someone with
>> familiarity of the C++ client can chime in here to expand on the partial
>> suggestions I do have:
>>
>> In the JMS case, the Qpid client actually sends the selector string to the
>> Java broker at the subscription creation (using an argument key of
>> "x-filter-jms-selector" with value of the JMS selector string) and it
>> performs server-side selection, only sending messages to the subscription
>> which match its selector (with the C++ broker, the JMS client currently
>> performs the selection client-side). One possibility might be examining
>> whether the same subscription argument can be sent during consumer
>> creation
>> with the C++ client, causing the broker to perform the selection for it.
>>
>
> Yes, you could do that using the x-subscribe e.g.
>
> std::string correlationId = ...;
> Receiver r = createReceiver("my-queue;
> {link:{x-subscribe:{arguments:{x-filter-jms-selector:'JMSCorrelationId = "
> + correlationId + "'}}}}");
>
>
>
>  Another possibility is that I know there has been work ongoing for the
>> 0.22/0.24/beyond releases on the C++ side to allow message selection using
>> the C++ client and C++ broker, but I don't know specifics about this such
>> as whether it is all server-side or if client-side is also supported that
>> you could use against the Java broker (which doesn't currently support the
>> syntax which would be necessary for doing the equivalent server-side
>> matching, as I believe the arguments and/or syntax used on the recent work
>> for the C++ components is slightly different due to being based around a
>> registered extension for use with AMQP 1.0)
>>
>
> From 0.22 you can specify a selector in the link directly, e.g.
>
> Receiver r = createReceiver("my-queue;
> {link:{x-subscribe:{arguments:{x-filter-jms-selector:\"colour in ('red',
> 'blue')\"}}}}");
>
> For 0-10 however that is set as an argument in subscribe with key
> 'x-apache-selector'. The only difference in syntax between the registered
> extension selector filter and JMS selectors is in the naming of the special
> properties (e.g. amqp.correlation-id instead of JMSCorrelationID)[1]. The
> client itself doesn't do any parsing or interpretation of the selector
> string, that will all be broker side.
>
> [1]
> https://svn.apache.org/repos/asf/qpid/trunk/qpid/specs/apache-filters.xml#type-selector-filter
>
> Can you clarify what you mean above? Are you saying the client will map
'x-filter-jms-selector' from the address string into 'x-apache-selector' in
the actual 0-10 subscribe command? Or was the second example meant to be
more different?

Either way, if the 0-10 subscribe argument were 'x-apache-selector' it wont
currently be picked up by the Java broker as it doesn't check for that
particular argument, only its 'historic x-filter-jms-selector'

Robbie

Reply via email to