qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robbie Gemmell <robbie.gemm...@gmail.com>
Subject Re: QPID JMS: Filtering messages based on Correlation ID
Date Fri, 14 Aug 2015 15:38:50 GMT
On 14 August 2015 at 15:37, Jakub Scholz <jakub@scholz.cz> wrote:
> I was wondering ... how can the Qpid JMS client setup a selector which
> would filter messages based on Correlation ID (and work against Qpid C++
> broker)?
>
> In the C++ Qpid Messaging API, the selector set like this:
> amqp.correlation_id = 'f5b13484-5d85-4669-ac2f-53a85b2c8fe7'
> seems to work fine.
>
> But in the Qpid JMS client, this triggers InvalidSelectorException. It
> seems that it doesn't like the dot. I tried to use also JMSCorrelationID
> instead of amqp.correlation_id, but the C++ broker doesn't seem to
> understand that.
>
> Thanks & Regards
> Jakub

Hi Jakub,

To answer the immediate question, I believe if you try the following
as your selector value (double quoting the name, essentially) it
should get round the InvalidSelectorException and work as desired
against the C++ broker:
"\"amqp.correlation_id\"='f5b13484-5d85-4669-ac2f-53a85b2c8fe7'"

The '.' is indeed the problem when you tried to amqp.correlation_id
directly, since it is an illegal character for a JMS property name. My
suggestion above leverages a workaround that the Qpid JMS clients and
brokers both understand to double quote the property name which has
the effect of sidestepping the syntax issue.

You have basically hit a bit of a current pain point still needing
solved. The client is sending the JMS selector string directly as the
value for its selector filter, which as you noted the broker isn't
entirely understanding it. The broker on the other hand is expecting
the client to send a filter value containing amqp.correlation_id since
the filter being used says thats what should happen. Unfortunately the
older JMS client and most if not all the other brokers I know using
that filter to do selectors with the JMS clients currently expect the
pure JMS selector string value to be in there, and changing it will
break things against all of those.

As a longer term fix, we discussed creating a new selector filter as
part of the AMQP JMS Mapping since the original filter has some other
issues outwith the way it is currently being (ab)used, but we have yet
to get to doing so. Something else I had thought of doing before then
was adding a toggle to the client so it can be made to do what the C++
broker rightly expects.

Robbie

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message