Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 755651 - getJMSReplyTo does not return null for null ReplyTo property
getJMSReplyTo does not return null for null ReplyTo property
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java (Show other bugs)
2.1
All All
medium Severity low
: 3.0
: ---
Assigned To: Rajith Attapattu
Irina Boverman
: EasyFix, Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-21 12:32 EST by Pavel Moravec
Modified: 2014-09-24 11:03 EDT (History)
5 users (show)

See Also:
Fixed In Version: qpid-java-0.22
Doc Type: Bug Fix
Doc Text:
It was discovered that the replyTo structure in getJMSReplyTo was checked for null values, however it's attributes were not checked. The replyTo struct could be set with null for the exchange and routing key, which resulted in a Destination being created with the exchange and routing key set to null on the receivers side. The fix checks for a null exchange and routing key, and returns null. This allows getJMSReplyTo to return null as designed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-24 11:03:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Simple patch proposal (805 bytes, patch)
2012-08-13 09:10 EDT, Pavel Moravec
no flags Details | Diff
Tar file containing test program source and test execution script. (4.59 KB, application/x-gzip)
2013-07-31 10:32 EDT, Irina Boverman
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Apache JIRA QPID-3636 None None None Never
Apache JIRA QPID-4617 None None None Never
Red Hat Product Errata RHEA-2014:1296 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.0 Release 2014-09-24 15:00:06 EDT

  None (edit)
Description Pavel Moravec 2011-11-21 12:32:54 EST
Description of problem:
Java client library wrongly returns reply-to via Message::getJMSReplyTo method for a message with setJMSReplyTo(null) called before.


Version-Release number of selected component (if applicable):
any (incl. 2.1)

How reproducible:
100%

Steps to Reproduce:
Use attached JUnit test. In short, the test performs:
1. msg.setJMSReplyTo(null);
2. producer.send(msg);
3. msg = consumer.receive();
4. msg.getJMSReplyTo() now returns:
:////?routingkey=''


Actual results:
msg.getJMSReplyTo() now returns:
:////?routingkey=''


Expected results:
msg.getJMSReplyTo() should return null


Additional info:
possible patch to be proposed
Comment 1 Pavel Moravec 2011-11-21 12:44:00 EST
JIRA case created: https://issues.apache.org/jira/browse/QPID-3636

The root cause of the bug is in calling:

AMQMessageDelegate_0_10.java:

    public Destination getJMSReplyTo()
    {
        ReplyTo replyTo = _messageProps.getReplyTo();

        if (replyTo == null)
        {
            return null;
        }
        else
        {

The _messageProps.getReplyTo() does not return null but "ReplyTo()".
Comment 4 Rajith Attapattu 2012-01-18 16:51:43 EST
This is a fairly low priority issue.
From an operational stand point IMO this has very little impact.

Given the high priority items we have on the plate, I would aim to fix this for 0.16 Qpid release if there is time.

Beyond that release, this will not be relevant as we might switch to the new client.
Comment 5 Irina Boverman 2012-01-20 12:32:29 EST
Updated release flag to 2.1.x and target milestone to 2.1.2.
Comment 7 Pavel Moravec 2012-08-09 07:59:19 EDT
(In reply to comment #4)
> This is a fairly low priority issue.
> From an operational stand point IMO this has very little impact.
> 
> Given the high priority items we have on the plate, I would aim to fix this
> for 0.16 Qpid release if there is time.
> 
> Beyond that release, this will not be relevant as we might switch to the new
> client.

Is the new client available in qpid-java-0.18? As checking qpid-java-*-0.18-1.el5 packages, the error is still there.

Or does 0.18 client offer a different API for that?

(I am happy to fix this if it makes sense, just let me know)
Comment 8 Pavel Moravec 2012-08-09 08:00:40 EDT
Btw. reproducer is attached in upstream JIRA: https://issues.apache.org/jira/secure/attachment/12504523/JMSReplyToTest.tar.gz
Comment 9 Pavel Moravec 2012-08-13 09:10:59 EDT
Created attachment 604001 [details]
Simple patch proposal

Simple patch proposal.

If message properties has "empty" ReplyTo, then default ReplyTo constructor is called having exchange and routingKey undefined (i.e. null). Thus extending the if statement.
Comment 11 Rajith Attapattu 2013-03-01 16:32:49 EST
Christos,

I'm will put in a fix for this specific case.

However I'm wondering why they are explicitly trying to set the replyTo field as null. If you don't specify it, then you get null as expected when you to getJMSReplyTo.

Regards,

Rajith
Comment 12 Rajith Attapattu 2013-03-01 17:24:30 EST
This is tracked upstream via QPID-4617
Pavel's patch is committed at rev http://svn.apache.org/r1451727
Comment 13 Rajith Attapattu 2013-03-07 14:52:27 EST
I have also fixed the root cause at rev http://svn.apache.org/r1453041
Comment 14 Irina Boverman 2013-07-31 10:32:03 EDT
Created attachment 781183 [details]
Tar file containing test program source and test execution script.
Comment 15 Irina Boverman 2013-07-31 10:35:23 EDT
VERIFIED on RHEL 6, X86_64 and i686:

Test script output:

JUnit version 4.5
.
Time: 0.769

OK (1 test)

Installed packages:

# rpm -qa | egrep "qpid|qmf" | sort
perl-qpid-0.22-5.el6.x86_64
perl-qpid-debuginfo-0.22-5.el6.x86_64
python-qpid-0.22-4.el6.noarch
python-qpid-proton-0.4-2.2.el6.x86_64
python-qpid-proton-doc-0.4-2.2.el6.x86_64
python-qpid-qmf-0.22-7.el6.x86_64
qpid-cpp-client-0.22-8.el6.x86_64
qpid-cpp-client-devel-0.22-8.el6.x86_64
qpid-cpp-client-devel-docs-0.22-8.el6.noarch
qpid-cpp-client-rdma-0.22-8.el6.x86_64
qpid-cpp-client-ssl-0.22-8.el6.x86_64
qpid-cpp-debuginfo-0.22-8.el6.x86_64
qpid-cpp-server-0.22-8.el6.x86_64
qpid-cpp-server-devel-0.22-8.el6.x86_64
qpid-cpp-server-ha-0.22-8.el6.x86_64
qpid-cpp-server-rdma-0.22-8.el6.x86_64
qpid-cpp-server-ssl-0.22-8.el6.x86_64
qpid-cpp-server-store-0.22-8.el6.x86_64
qpid-cpp-server-xml-0.22-8.el6.x86_64
qpid-java-client-0.22-5.el6.noarch
qpid-java-common-0.22-5.el6.noarch
qpid-java-example-0.22-5.el6.noarch
qpid-proton-c-0.4-2.2.el6.x86_64
qpid-proton-c-devel-0.4-2.2.el6.x86_64
qpid-proton-debuginfo-0.4-2.2.el6.x86_64
qpid-qmf-0.22-7.el6.x86_64
qpid-qmf-debuginfo-0.22-7.el6.x86_64
qpid-qmf-devel-0.22-7.el6.x86_64
qpid-snmpd-debuginfo-1.0.0-12.el6.x86_64
qpid-tests-0.22-4.el6.noarch
qpid-tools-0.22-3.el6.noarch
rh-qpid-cpp-tests-0.22-8.el6.x86_64
ruby-qpid-qmf-0.22-7.el6.x86_64

----------

# rpm -qa | egrep "qpid|qmf" | sort
python-qpid-0.22-4.el6.noarch
python-qpid-qmf-0.22-7.el6.i686
qpid-cpp-client-0.22-8.el6.i686
qpid-cpp-client-devel-0.22-8.el6.i686
qpid-cpp-client-devel-docs-0.22-8.el6.noarch
qpid-cpp-client-rdma-0.22-8.el6.i686
qpid-cpp-client-ssl-0.22-8.el6.i686
qpid-cpp-debuginfo-0.22-8.el6.i686
qpid-cpp-server-0.22-8.el6.i686
qpid-cpp-server-devel-0.22-8.el6.i686
qpid-cpp-server-ha-0.22-8.el6.i686
qpid-cpp-server-rdma-0.22-8.el6.i686
qpid-cpp-server-ssl-0.22-8.el6.i686
qpid-cpp-server-store-0.22-8.el6.i686
qpid-cpp-server-xml-0.22-8.el6.i686
qpid-cpp-tar-0.22-8.el6.noarch
qpid-java-client-0.22-5.el6.noarch
qpid-java-common-0.22-5.el6.noarch
qpid-java-example-0.22-5.el6.noarch
qpid-proton-c-0.4-2.2.el6.i686
qpid-proton-c-devel-0.4-2.2.el6.i686
qpid-proton-debuginfo-0.4-2.2.el6.i686
qpid-qmf-0.22-7.el6.i686
qpid-qmf-debuginfo-0.22-7.el6.i686
qpid-qmf-devel-0.22-7.el6.i686
qpid-snmpd-1.0.0-12.el6.i686
qpid-snmpd-debuginfo-1.0.0-12.el6.i686
qpid-tests-0.22-4.el6.noarch
qpid-tools-0.22-3.el6.noarch
rh-qpid-cpp-tests-0.22-8.el6.i686
Comment 21 errata-xmlrpc 2014-09-24 11:03:32 EDT
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/RHEA-2014-1296.html

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