You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Bryan Dixon <br...@bldixon.net> on 2018/03/22 17:55:06 UTC

JMSMessageID differences in JMS 0.30.0 and JMS AMQP 0-x 6.3.0 clients

We are using Qpid JMS 0.30.0 to publish messages to a Broker-J 7.0.2 broker. 
We have some java apps that have to use the older JMS AMQP 0-x 6.3.0 client
and others that can use the newer JMS 0.30.0 client.  I just found that when
using the JMS Message.getJMSMessageID() method call for the same message
results in 2 different messages Ids being returned by each client version.  
That by itself I guess is OK but not what I would expect.  The bigger issue
I just noticed with the older JMS AMQP 0-x 6.3.0 client is when I get the
JMSMessageID value, I can't use that value returned in a message selector to
retrieve (either consume or browse) that message - the message is not found.

Here is an example.  I published a message and the JMS JMS 0.30.0 client
returns the following value from the Message.getJMSMessageID()  call:
ID:eventapp-40500566-2ca4-439e-9a2d-4e00c88ea682:9:1:1-1

However when using the JMS AMQP 0-x 6.3.0 client Message.getJMSMessageID() 
call on the same exact message call the following ID is returned:
ID:fcae0a4b-9810-3214-b161-8572e5df8ea6

When I use the QueueBrowser class with the JMS AMQP 0-x 6.3.0 client to
browse the message using this message selector the message is not returned
by the browse() method:
JMSMessageID ='ID:fcae0a4b-9810-3214-b161-8572e5df8ea6'

It doesn't seem right that the 6.3.0 client can't retrieve the message by
the JMSMessageID it returned.

I need a way to be able to retrieve a message by its ID for the  6.3.0
client.  This does work successfully wit the JMS 0.30.0 client.

Bryan







--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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


Re: JMSMessageID differences in JMS 0.30.0 and JMS AMQP 0-x 6.3.0 clients

Posted by Oleksandr Rudyy <or...@gmail.com>.
Hi Bryan,

Using 0-91 AMQP client should work as expected. I am not aware about
any issue with such approach.

The issue you had run with 0-10 amqp client is caused by 0-10 protocol
restriction which limits message id types to UUID only. The conversion
layer of Broker-J converts the String message id values generated on
amqp 1-0 client into UUID type. Thus, the value of JMSMessageID is
changed in result of conversion. The filtering functionality cannot
find the message as the  converted message id in selector expression
does not match the real message id.

The alternative solution for the issue would be to use custom
application specific header for the message id.

The other alternative would be to configure amqp 1.0 JMS client to
generate JMSMessageIDs as UUID values using UUID policy
(jms.messageIDPolicy.messageIDType=UUID) but it does not work as
expected. The JMS Clients adds prefix "ID:" or "ID:AMQP_UUID:" to the
string representation of message id and Broker fails to find the
message with given prefixes. The Broker (and it seems new JMS client)
would need to be changed to have this working properly. I raised
defects [1] and [2] to address the issues.

Kind Regards,
Alex

[1] https://issues.apache.org/jira/browse/QPID-8139
[2] https://issues.apache.org/jira/browse/QPIDJMS-371


On 23 March 2018 at 16:32, Bryan Dixon <br...@bldixon.net> wrote:
> We are getting close to going live in production with Broker-J and since I
> need to stabilize everything what I'm going to do for the time being is set
> the JVM Property qpid.amqp.version to 0-91.  I tested all our clients with
> that and was able to get the desired results.  If you think there are any
> issues with putting this in a production environment please let me know.
>
> Thanks
> Bryan
>
>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> 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


Re: JMSMessageID differences in JMS 0.30.0 and JMS AMQP 0-x 6.3.0 clients

Posted by Bryan Dixon <br...@bldixon.net>.
We are getting close to going live in production with Broker-J and since I
need to stabilize everything what I'm going to do for the time being is set
the JVM Property qpid.amqp.version to 0-91.  I tested all our clients with
that and was able to get the desired results.  If you think there are any
issues with putting this in a production environment please let me know.

Thanks
Bryan



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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


Re: JMSMessageID differences in JMS 0.30.0 and JMS AMQP 0-x 6.3.0 clients

Posted by Keith W <ke...@gmail.com>.
Thanks Bryan - that's clear now.  We'll take a look.

On 22 March 2018 at 19:11, Bryan Dixon <br...@bldixon.net> wrote:
> I have an example attached.   The PublishMessage code needs to use the JMS
> 0.30.0 client.  The BrowseMessage code needs to use the MS AMQP 0-x 6.3.0
> client.  When you run the BrowseMessage after publishing the message you'll
> see where it can't find the message by the JMSMessageID it is returning.
>
> What's more interesting is in the BrowseMessage if you uncomment this code:
> System.setProperty("qpid.amqp.version", "0-8");
>
> it works successfully.  And the JMSMessageID is what I get when I get the
> message id from a JMS 0.30.0 client.
>
>
> PublishMessage.java
> <http://qpid.2158936.n2.nabble.com/file/t396334/PublishMessage.java>
> BrowseMessage.java
> <http://qpid.2158936.n2.nabble.com/file/t396334/BrowseMessage.java>
>
>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> 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


Re: JMSMessageID differences in JMS 0.30.0 and JMS AMQP 0-x 6.3.0 clients

Posted by Bryan Dixon <br...@bldixon.net>.
I have an example attached.   The PublishMessage code needs to use the JMS
0.30.0 client.  The BrowseMessage code needs to use the MS AMQP 0-x 6.3.0
client.  When you run the BrowseMessage after publishing the message you'll
see where it can't find the message by the JMSMessageID it is returning.  

What's more interesting is in the BrowseMessage if you uncomment this code:
System.setProperty("qpid.amqp.version", "0-8");

it works successfully.  And the JMSMessageID is what I get when I get the
message id from a JMS 0.30.0 client.


PublishMessage.java
<http://qpid.2158936.n2.nabble.com/file/t396334/PublishMessage.java>  
BrowseMessage.java
<http://qpid.2158936.n2.nabble.com/file/t396334/BrowseMessage.java>  



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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


Re: JMSMessageID differences in JMS 0.30.0 and JMS AMQP 0-x 6.3.0 clients

Posted by Keith W <ke...@gmail.com>.
On 22 March 2018 at 18:59, Robbie Gemmell <ro...@gmail.com> wrote:
> I'd guess that the brokers message conversion is taking the sent AMQP
> 1.0 message, finding it has a string message-id, and processing it
> such that it ends up with a UUID in the converted AMQP 0-10 message
> metadata. That in itself isnt an issue, but if thats happening the
> broker would also need to ensure 0-10 consumers had processed the ID
> similarly when any selection is being performed for them.
>

Possible.  I wasn't completely certain from Bryan's description if it
was relying of the Broker's message conversion feature.   Some
producer and consumer code would take the guess work away.

> Robbie
>
> On 22 March 2018 at 18:48, Keith W <ke...@gmail.com> wrote:
>> Bryan,
>>
>> That seems surprising. I am not aware of any such problem.  Do you
>> have an executable example that demonstrates the problem?
>>
>> cheers, Keith.
>>
>> On 22 March 2018 at 17:55, Bryan Dixon <br...@bldixon.net> wrote:
>>> We are using Qpid JMS 0.30.0 to publish messages to a Broker-J 7.0.2 broker.
>>> We have some java apps that have to use the older JMS AMQP 0-x 6.3.0 client
>>> and others that can use the newer JMS 0.30.0 client.  I just found that when
>>> using the JMS Message.getJMSMessageID() method call for the same message
>>> results in 2 different messages Ids being returned by each client version.
>>> That by itself I guess is OK but not what I would expect.  The bigger issue
>>> I just noticed with the older JMS AMQP 0-x 6.3.0 client is when I get the
>>> JMSMessageID value, I can't use that value returned in a message selector to
>>> retrieve (either consume or browse) that message - the message is not found.
>>>
>>> Here is an example.  I published a message and the JMS JMS 0.30.0 client
>>> returns the following value from the Message.getJMSMessageID()  call:
>>> ID:eventapp-40500566-2ca4-439e-9a2d-4e00c88ea682:9:1:1-1
>>>
>>> However when using the JMS AMQP 0-x 6.3.0 client Message.getJMSMessageID()
>>> call on the same exact message call the following ID is returned:
>>> ID:fcae0a4b-9810-3214-b161-8572e5df8ea6
>>>
>>> When I use the QueueBrowser class with the JMS AMQP 0-x 6.3.0 client to
>>> browse the message using this message selector the message is not returned
>>> by the browse() method:
>>> JMSMessageID ='ID:fcae0a4b-9810-3214-b161-8572e5df8ea6'
>>>
>>> It doesn't seem right that the 6.3.0 client can't retrieve the message by
>>> the JMSMessageID it returned.
>>>
>>> I need a way to be able to retrieve a message by its ID for the  6.3.0
>>> client.  This does work successfully wit the JMS 0.30.0 client.
>>>
>>> Bryan
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
> ---------------------------------------------------------------------
> 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


Re: JMSMessageID differences in JMS 0.30.0 and JMS AMQP 0-x 6.3.0 clients

Posted by Robbie Gemmell <ro...@gmail.com>.
I'd guess that the brokers message conversion is taking the sent AMQP
1.0 message, finding it has a string message-id, and processing it
such that it ends up with a UUID in the converted AMQP 0-10 message
metadata. That in itself isnt an issue, but if thats happening the
broker would also need to ensure 0-10 consumers had processed the ID
similarly when any selection is being performed for them.

Robbie

On 22 March 2018 at 18:48, Keith W <ke...@gmail.com> wrote:
> Bryan,
>
> That seems surprising. I am not aware of any such problem.  Do you
> have an executable example that demonstrates the problem?
>
> cheers, Keith.
>
> On 22 March 2018 at 17:55, Bryan Dixon <br...@bldixon.net> wrote:
>> We are using Qpid JMS 0.30.0 to publish messages to a Broker-J 7.0.2 broker.
>> We have some java apps that have to use the older JMS AMQP 0-x 6.3.0 client
>> and others that can use the newer JMS 0.30.0 client.  I just found that when
>> using the JMS Message.getJMSMessageID() method call for the same message
>> results in 2 different messages Ids being returned by each client version.
>> That by itself I guess is OK but not what I would expect.  The bigger issue
>> I just noticed with the older JMS AMQP 0-x 6.3.0 client is when I get the
>> JMSMessageID value, I can't use that value returned in a message selector to
>> retrieve (either consume or browse) that message - the message is not found.
>>
>> Here is an example.  I published a message and the JMS JMS 0.30.0 client
>> returns the following value from the Message.getJMSMessageID()  call:
>> ID:eventapp-40500566-2ca4-439e-9a2d-4e00c88ea682:9:1:1-1
>>
>> However when using the JMS AMQP 0-x 6.3.0 client Message.getJMSMessageID()
>> call on the same exact message call the following ID is returned:
>> ID:fcae0a4b-9810-3214-b161-8572e5df8ea6
>>
>> When I use the QueueBrowser class with the JMS AMQP 0-x 6.3.0 client to
>> browse the message using this message selector the message is not returned
>> by the browse() method:
>> JMSMessageID ='ID:fcae0a4b-9810-3214-b161-8572e5df8ea6'
>>
>> It doesn't seem right that the 6.3.0 client can't retrieve the message by
>> the JMSMessageID it returned.
>>
>> I need a way to be able to retrieve a message by its ID for the  6.3.0
>> client.  This does work successfully wit the JMS 0.30.0 client.
>>
>> Bryan
>>
>>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>>
>> ---------------------------------------------------------------------
>> 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
>

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


Re: JMSMessageID differences in JMS 0.30.0 and JMS AMQP 0-x 6.3.0 clients

Posted by Keith W <ke...@gmail.com>.
Bryan,

That seems surprising. I am not aware of any such problem.  Do you
have an executable example that demonstrates the problem?

cheers, Keith.

On 22 March 2018 at 17:55, Bryan Dixon <br...@bldixon.net> wrote:
> We are using Qpid JMS 0.30.0 to publish messages to a Broker-J 7.0.2 broker.
> We have some java apps that have to use the older JMS AMQP 0-x 6.3.0 client
> and others that can use the newer JMS 0.30.0 client.  I just found that when
> using the JMS Message.getJMSMessageID() method call for the same message
> results in 2 different messages Ids being returned by each client version.
> That by itself I guess is OK but not what I would expect.  The bigger issue
> I just noticed with the older JMS AMQP 0-x 6.3.0 client is when I get the
> JMSMessageID value, I can't use that value returned in a message selector to
> retrieve (either consume or browse) that message - the message is not found.
>
> Here is an example.  I published a message and the JMS JMS 0.30.0 client
> returns the following value from the Message.getJMSMessageID()  call:
> ID:eventapp-40500566-2ca4-439e-9a2d-4e00c88ea682:9:1:1-1
>
> However when using the JMS AMQP 0-x 6.3.0 client Message.getJMSMessageID()
> call on the same exact message call the following ID is returned:
> ID:fcae0a4b-9810-3214-b161-8572e5df8ea6
>
> When I use the QueueBrowser class with the JMS AMQP 0-x 6.3.0 client to
> browse the message using this message selector the message is not returned
> by the browse() method:
> JMSMessageID ='ID:fcae0a4b-9810-3214-b161-8572e5df8ea6'
>
> It doesn't seem right that the 6.3.0 client can't retrieve the message by
> the JMSMessageID it returned.
>
> I need a way to be able to retrieve a message by its ID for the  6.3.0
> client.  This does work successfully wit the JMS 0.30.0 client.
>
> Bryan
>
>
>
>
>
>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> 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