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 16:41:05 GMT
On 14 August 2015 at 17:17, Jakub Scholz <jakub@scholz.cz> wrote:
> Hi Robbie,
>
> Thanks. You are right, double quotes help to solve this. I was quite close
> when I tried single quotes, but they don't help. And trying double quotes
> didn't come to my mind.
>
> The compatibility issue across different brokers is for sure unfortunate.
> Although it at least has a workaround. I wonder how the other brokers plan
> to deal with the non-JMS clients. It would sound a bit strange if you tell
> someone to use a filter "JMSCorrelationID = 123" in a C++ AMQP client.
>

The underlying filter being used was actually described as avoiding
exactly that (albeit with some issues). Unfortunately most current
uses of the filter in implementations expect/transfer the pure JMS
selector string, currently including the new client so it would work
with those others.

> The "C++ broker" toggle is an interesting idea - it would probably make the
> switch to other brokers easier. On the other hand, it sounds like a bad
> marketing - it would be hard to convince people about the benefits of AMQP
> if you then tell them that they have to use this and that switch for
> compatibility between different AMQP components :-o.
>

Yes, that was only a thought of one way to make things 'work' with the
C++ broker in the interim, not something I would be suggesting would
be common place or a long term solution. For that a new filter
resolving the issues of the old one and actually being used properly
would be the way to go.

> Thanks & Regards
> Jakub
>
>
>
>
>
> On Fri, Aug 14, 2015 at 5:38 PM, Robbie Gemmell <robbie.gemmell@gmail.com>
> wrote:
>
>> 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
>>
>>

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


Mime
View raw message