Bug 704596 - The toString() representation of the JMSDestination of a received message is different from the toString() representation on the sender side.
Summary: The toString() representation of the JMSDestination of a received message is ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java
Version: Development
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: 2.1.2
: ---
Assignee: Rajith Attapattu
QA Contact: Zdenek Kraus
URL:
Whiteboard:
Depends On:
Blocks: 783492
TreeView+ depends on / blocked
 
Reported: 2011-05-13 17:25 UTC by Rajith Attapattu
Modified: 2018-11-27 21:39 UTC (History)
8 users (show)

Fixed In Version: qpid-java-0.14-1.el5
Doc Type: Bug Fix
Doc Text:
Cause: The JMSDestination of receiving message defaults to BURL syntax. Consequence: The toString() output of sender and receiver side prints the JMS destination in different syntaxes causing confusion. Fix: The code now use the default syntax of the client when creating the JMSDestination from the incoming message. Result: The toString() of the JMSDestination is now in the same syntax provided the default syntax of the receiver matches the syntax of the JMS Destination used by the sender.
Clone Of:
Environment:
Last Closed: 2012-04-30 17:51:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0529 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise MRG Messaging 2.1 security and enhancement update 2012-04-30 21:48:25 UTC

Description Rajith Attapattu 2011-05-13 17:25:41 UTC
Description of problem:
The value of toString() on the JMS Destination of a message being sent is different from to the toString() value of JMS Destination of the same message on the receiver side. 


Ex for clients using the BURL syntax.

Sender side
The JMSDestination on the sent message is 
“direct://amq.direct//testQueue?routingkey='key1'”

Receiver side
The JMSDestination on the recvd message is 
“direct://amq.direct/key1/key1?routingkey='key1'”

Ex for client using the ADDR syntax.

Sender side
JMS Destination: 'amq.direct'/'test'; None

Receiver side
JMS Destination: direct://amq.direct/test/test?routingkey='test'

How reproducible:
Always

Steps to Reproduce:
1. Use spout to send a message and observe the JMS Destination printed on the screen.
2. Use drain to receive that message and observe the same.
3. Note that they are represented differently.
  
Actual results:
The toString representations are different.
(However they contain the correct exchange and routing key information).

Expected results:
The toString representations should be the same.

Comment 1 Rajith Attapattu 2011-09-05 03:28:42 UTC
This issue is tracked in upstream via https://issues.apache.org/jira/browse/QPID-3466

A fix has been committed upstream, details as follows,
http://svn.apache.org/viewvc?view=rev&rev=1165148

Comment 2 Zdenek Kraus 2011-09-07 13:28:14 UTC
We discover problem with the fix.
For ADDR syntax toString() representation of JMSDestination of received message is correctly same as sender's.
But for BURL syntax it is not.

previous results (qpid-java-*-0.10-6):
..summary BURL
...SEND: direct://amq.direct/bz704596/test?routingkey='bz704596'
...RECV: direct://amq.direct/bz704596/bz704596?routingkey='bz704596'

..summary ADDR
...SEND: 'amq.direct'/'bz704596'
...RECV: direct://amq.direct/bz704596/bz704596?routingkey='bz704596'

current results (qpid-java-*-0.10-7):
..summary BURL
...SEND: direct://amq.direct/bz704596/test?routingkey='bz704596'
...RECV: 'amq.direct'/'bz704596'

..summary ADDR
...SEND: 'amq.direct'/'bz704596'
...RECV: 'amq.direct'/'bz704596'

Comment 3 Rajith Attapattu 2011-09-09 12:52:42 UTC
This is bcos the the JMSDestination being sent over the wire does not contain any information about the syntax. So on the senders side it's formatted according to the default destination syntax. This is why you see the BURL also being formatted as a ADDR.

However if you set the default destination syntax to BURL the exact opposite will happen.

Comment 4 Zdenek Kraus 2011-09-12 10:00:07 UTC
Thanks for clarifying Rajith.

I tested it with changin default destination syntax with -Dqpid.dest_syntax=BURL and I discovered problem with BURL.

supplied BURL address to Spout:
BURL:direct://amq.direct/test?routingkey='bz704596'

received address strings from Spout and Drain
...SEND: direct://amq.direct/bz704596/test?routingkey='bz704596'
...RECV: direct://amq.direct/bz704596/bz704596?routingkey='bz704596'

Comment 5 Rajith Attapattu 2011-09-12 21:29:50 UTC
Zdenek,

This has been how it's displayed for a long tine in the java client and at this time we will not be doing anything to change it. Please note this patch did not change the existing behaviour of BURL strings were displayed.

The BURL form is deprecated we will not be doing any active development on it any longer.
Going forward we should test everything with Address strings including JCA as that is the default destination syntax.

When we redesign the Java client BURL will be completely dropped.

Regards,

Rajith

Comment 7 Zdenek Kraus 2012-01-13 10:11:00 UTC
Testing packages:
java-1.5.0-ibm-1.5.0.12.4-1jpp.1.el5
java-1.6.0-sun-1.6.0.26-1jpp.1.el5
java-1.6.0-ibm-1.6.0.9.1-1jpp.1.el5
java-1.6.0-openjdk-1.6.0.0-1.23.1.9.10.el5_7
qpid-java-client-0.14-1.el5

qpid-java-client-0.14-1.el6.noarch
java-1.6.0-openjdk-1.6.0.0-1.41.1.10.4.el6.i686
java-1.5.0-ibm-1.5.0.12.5-1jpp.1.el6.i686
java-1.6.0-ibm-1.6.0.9.2-1jpp.2.el6.i686


Tested on:
 RHEL5.7 x86 x86_64
 RHEL6.2 x86 x86_64

ADDR representation is correct ADDR->ADDR, BURL->ADDR.
BURL representation differs as described in comment #4 and comment #5.

Comment 8 Zdenek Kraus 2012-01-24 09:28:20 UTC
according to testing results (see comment #7) -> VERIFIED

please make sure that technical note contains warning about BURL syntax difference.

Comment 9 Rajith Attapattu 2012-03-12 15:19:48 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: The JMSDestination of receiving message defaults to BURL syntax.

Consequence:  The toString() output of sender and receiver side prints the JMS destination in different syntaxes causing confusion.

Fix:  The code now use the default syntax of the client when creating the JMSDestination from the incoming message.

Result:  The toString() of the JMSDestination is now in the same syntax provided the default syntax of the receiver matches the syntax of the JMS Destination used by the sender.

Comment 10 errata-xmlrpc 2012-04-30 17:51:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0529.html


Note You need to log in before you can comment on or make changes to this bug.