Bug 732534 - Can't send QMFv2 requests from JMS due to inability to set app-id
Summary: Can't send QMFv2 requests from JMS due to inability to set app-id
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java
Version: 2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 2.0.3
: ---
Assignee: Rajith Attapattu
QA Contact: Zdenek Kraus
URL:
Whiteboard:
Depends On:
Blocks: 738352
TreeView+ depends on / blocked
 
Reported: 2011-08-22 20:05 UTC by Mike Cressman
Modified: 2018-11-14 11:42 UTC (History)
4 users (show)

Fixed In Version: qpid-java-0.10-9
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 738352 (view as bug list)
Environment:
Last Closed: 2011-09-28 15:53:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Example of QMF usage (3.41 KB, application/octet-stream)
2011-09-01 13:27 UTC, Zdenek Kraus
no flags Details
Simple reproducer (1.08 KB, text/x-java)
2011-09-08 15:29 UTC, Rajith Attapattu
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1339 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 2.0.3 bug fix update 2011-09-28 15:53:35 UTC

Description Mike Cressman 2011-08-22 20:05:49 UTC
Description of problem:
Sending QMFv2 requests from the Java client fails because the the app-id is not set.


Version-Release number of selected component (if applicable):
qpid-java-0.10-6

How reproducible:
100%

Steps to Reproduce:
Write a java client app to send a map message QMFv2 request to the broker.
  
Actual results:
Broker ignores request.

Expected results:
Broker acts on request.

Additional info:

The Java client needs to set the x-amqp-0-10.app-id property.

See https://issues.apache.org/jira/browse/QPID-3302 for the patch.

Comment 1 Zdenek Kraus 2011-08-26 09:21:49 UTC
Hi Mike,

could you write some short example, that reproduces failure ?

Comment 2 Zdenek Kraus 2011-08-29 09:39:03 UTC
Hi Rajith,

you wrote at JIRA, that you fixed this bug with some test case. 
We found you commit r1153274 and there was no test case attached.
Would you kindly post a link or upload this test case to bugzilla ?

Thank you.

Comment 3 Rajith Attapattu 2011-08-30 18:02:12 UTC
This issue is tracked in upstream via QPID-3302
A fix is committed in upstream, details as follows,

http://svn.apache.org/viewvc?view=rev&rev=1140412

test case,
http://svn.apache.org/viewvc?view=rev&rev=1140413

Comment 4 Rajith Attapattu 2011-08-30 18:10:09 UTC
Hi Zdenek,

The test case is committed at http://svn.apache.org/viewvc?view=rev&rev=1140413
It's a junit test case that is run as part of the java build.

The basic idea of the test case is,

1. Create a JMS connection, session and a message consumer & producer.
   Connection con = new AMQConnection("amqp://username:password@clientid/test?brokerlist='tcp://localhost:5672'");
   con.start();

   Session ssn = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);

   Topic topic = ssn.createTopic("test");
   MessageConsumer consumer = ssn.createConsumer(topic);
   MessageProducer prod = ssn.createProducer(topic);

2. Create a message and set the app id as follows,
   Message m = ssn.createMessage();
   m.setObjectProperty("x-amqp-0-10.app-id", "my-app-id");

3. Send the msg and try to receive it.
   prod.send(m);
   Message msg = consumer.receive(1000);
   
4. Verify that you can retrieve the app id from the message and verify it.
   msg.getStringProperty("x-amqp-0-10.app-id")

Comment 5 Zdenek Kraus 2011-09-01 13:27:01 UTC
Created attachment 521012 [details]
Example of QMF usage

Hi Rajith,

I took the new testcase and compile it with other unit tests, but the test case is already passing with the old version, which it should not.

I think the new 'testApplicationProperties()' in .../JMSPropertiesTest.java does not testing exactly the bug. But I found an example of QMF usage and it looks like to be a good reproducer. Could you please look at it and check it, if it's correct ?


Source:
http://apache-qpid-users.2158936.n2.nabble.com/QMF-java-example-td6462608.html

Comment 6 Rajith Attapattu 2011-09-08 15:29:06 UTC
Created attachment 522148 [details]
Simple reproducer

Comment 7 Rajith Attapattu 2011-09-08 15:34:55 UTC
Zdenek,

That QMF example is correct and you could use that to verify it.
I also attached a simple reproducer that tests specifically for this.

Feel free to use both to verify the fixes. Ping me on irc if u have questions.

Regards,

Rajith

Comment 8 Zdenek Kraus 2011-09-14 12:00:36 UTC
Fix was tested on:
RHEL 5.7 x86/x64
qpid-java-common-0.10-9.el5
qpid-java-client-0.10-9.el5
qpid-java-jca-0.10-9.el5
qpid-java-example-0.10-9.el5

RHEL 6.1 x86/x64
qpid-java-jca-0.10-9.el6.noarch
qpid-java-common-0.10-9.el6.noarch
qpid-java-example-0.10-9.el6.noarch
qpid-java-client-0.10-9.el6.noarch

changing to VERIFIED

Comment 9 errata-xmlrpc 2011-09-28 15:53:41 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/RHBA-2011-1339.html


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