Bug 962461 - Unable to read the application headers of messages sent by the perl client using the JMS client
Unable to read the application headers of messages sent by the perl client us...
Status: NEW
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: perl-qpid (Show other bugs)
2.3
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ted Ross
Ernie
: WorkAround
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-13 10:39 EDT by Petr Matousek
Modified: 2018-02-06 11:43 EST (History)
4 users (show)

See Also:
Fixed In Version: perl-qpid-0.22-5.el6, perl-qpid-0.22-5.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Apache JIRA QPID-4842 None None None Never
Apache JIRA QPID-4843 None None None Never
Apache JIRA QPID-5067 None None None Never

  None (edit)
Description Petr Matousek 2013-05-13 10:39:15 EDT
Description of problem:

I was unable to read the application headers of messages sent by the perl example client using the JMS example client.

ie.
# cd /usr/share/doc/perl-qpid-0.18/examples
# perl spout.pl -P foo=bar  "q;{create:always}"
# cd /usr/share/doc/qpid-java-0.18/examples/
# ./run_example.sh org.apache.qpid.example.Drain q | grep Properties
Properties:<NONE>

Properties of the received message shall list 'foo = bar'.

note: JMS client is able to read properly the application headers of messages sent by c++/python clients.

Version-Release number of selected component (if applicable):
perl-qpid-0.18-2
qpid-java-*-0.18-7

How reproducible:
100%

Steps to Reproduce:
1. ruby spout.rb -P foo=bar "q;{create:always}"
2. ./run_example.sh org.apache.qpid.example.Drain q
3. The properties list is empty
  
Actual results:
Unable to read the app. headers of messages sent by perl client using the JMS client.

Expected results:
The JMS client properly reads the app. headers of messages sent by perl client

Additional info:
Comment 1 Darryl L. Pierce 2013-05-14 17:16:55 EDT
(In reply to comment #0)
> Steps to Reproduce:
> 1. ruby spout.rb -P foo=bar "q;{create:always}"
> 2. ./run_example.sh org.apache.qpid.example.Drain q
> 3. The properties list is empty

The above steps are calling the Ruby examples and not the Perl examples.

In doing the same thing with the Perl spout example I was able to read the properties using the Perl drain example as well as the Ruby drain example.

But it seems that the Ruby spout example, which was used above, has a bug that was not correctly setting properties from the command.
   
Once that bug was fixed, properties passed in the from the command line are properly sent.
Comment 2 Darryl L. Pierce 2013-05-14 17:31:16 EDT
This fix for this is committed upstream:

http://svn.apache.org/viewvc?view=revision&revision=1482597
Comment 3 Petr Matousek 2013-05-15 03:16:13 EDT
(In reply to comment #1)
> (In reply to comment #0)
> > Steps to Reproduce:
> > 1. ruby spout.rb -P foo=bar "q;{create:always}"
> > 2. ./run_example.sh org.apache.qpid.example.Drain q
> > 3. The properties list is empty
> 
> The above steps are calling the Ruby examples and not the Perl examples.
> 
> In doing the same thing with the Perl spout example I was able to read the
> properties using the Perl drain example as well as the Ruby drain example.
> 
> But it seems that the Ruby spout example, which was used above, has a bug
> that was not correctly setting properties from the command.
>    
> Once that bug was fixed, properties passed in the from the command line are
> properly sent. 

Yes, I made a mistake by reporting this bug (I was reporting the same bug for ruby client at the same time), Naturally the step 1 of the reproducer scenario shall use the perl spout example:

- 1. ruby spout.rb -P foo=bar "q;{create:always}"
+ 1. perl spout.pl -P foo=bar "q;{create:always}"

BUT there is no issue in sending/reading properties (perl|ruby)->(perl|ruby), it's working properly. The issue here is with (perl|ruby)-> JMS client.

When users sends a message using the spout client and set some properties, the properties can't be read with the JMS drain example. Which precisely shows the commands in the description of the comment 1.

ie.
# cd /usr/share/doc/perl-qpid-0.18/examples
# perl spout.pl -P foo=bar  "q;{create:always}"
# cd /usr/share/doc/qpid-java-0.18/examples/
# ./run_example.sh org.apache.qpid.example.Drain q | grep Properties
Properties:<NONE>

note: JMS client is able to read properly the application headers of messages sent by c++/python clients.

Does the fix mentioned in comment 2 fix this issue?
Comment 4 Darryl L. Pierce 2013-05-15 09:12:56 EDT
(In reply to comment #3)
> (In reply to comment #1)
> > (In reply to comment #0)
> > > Steps to Reproduce:
> > > 1. ruby spout.rb -P foo=bar "q;{create:always}"
> > > 2. ./run_example.sh org.apache.qpid.example.Drain q
> > > 3. The properties list is empty
> > 
> > The above steps are calling the Ruby examples and not the Perl examples.
> > 
> > In doing the same thing with the Perl spout example I was able to read the
> > properties using the Perl drain example as well as the Ruby drain example.
> > 
> > But it seems that the Ruby spout example, which was used above, has a bug
> > that was not correctly setting properties from the command.
> >    
> > Once that bug was fixed, properties passed in the from the command line are
> > properly sent. 
> 
> Yes, I made a mistake by reporting this bug (I was reporting the same bug
> for ruby client at the same time), Naturally the step 1 of the reproducer
> scenario shall use the perl spout example:
> 
> - 1. ruby spout.rb -P foo=bar "q;{create:always}"
> + 1. perl spout.pl -P foo=bar "q;{create:always}"

There was a bug in the perl spout.pl file that produced a similar problem that I fixed up stream in this commit;

http://svn.apache.org/viewvc?view=revision&revision=1482598

> BUT there is no issue in sending/reading properties
> (perl|ruby)->(perl|ruby), it's working properly. The issue here is with
> (perl|ruby)-> JMS client.
> 
> When users sends a message using the spout client and set some properties,
> the properties can't be read with the JMS drain example. Which precisely
> shows the commands in the description of the comment 1.
> 
> ie.
> # cd /usr/share/doc/perl-qpid-0.18/examples
> # perl spout.pl -P foo=bar  "q;{create:always}"
> # cd /usr/share/doc/qpid-java-0.18/examples/
> # ./run_example.sh org.apache.qpid.example.Drain q | grep Properties
> Properties:<NONE>
> 
> note: JMS client is able to read properly the application headers of
> messages sent by c++/python clients.
> 
> Does the fix mentioned in comment 2 fix this issue?

The subsequent commit upstream fixes Perl.
Comment 5 Justin Ross 2013-05-15 09:37:19 EDT
(In reply to comment #4)
> The subsequent commit upstream fixes Perl.

I need to quickly clarify this one.  The "subsequent" commit?  Does that refer to a commit not already mentioned here, or does that refer to 1482598?
Comment 6 Darryl L. Pierce 2013-05-15 10:40:00 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > The subsequent commit upstream fixes Perl.
> 
> I need to quickly clarify this one.  The "subsequent" commit?  Does that
> refer to a commit not already mentioned here, or does that refer to 1482598?

It refers to 1482598.
Comment 7 Ernie 2013-08-02 15:54:01 EDT
Setting back to assigned. The java client is not picking up the message properties that are set by the perl client.

On rhel 6.4 64
rpm -qa | egrep  qpid-java\|perl-qpid\|python-qpid
qpid-java-client-0.22-5.el6.noarch
python-qpid-qmf-0.22-7.el6.x86_64
qpid-java-common-0.22-5.el6.noarch
qpid-java-example-0.22-5.el6.noarch
perl-qpid-0.22-5.el6.x86_64
python-qpid-0.22-4.el6.noarch

as root
qpid-config add queue q
cd /usr/share/doc/perl-qpid-0.22/examples
./spout.pl -P foo=bar --content "perl message" q

cd /usr/share/doc/qpid-java-0.22/examples
./run_example.sh org.apache.qpid.example.Drain q
{}

------------- Msg -------------
Body:
perl message
JMS Correlation ID: 
JMS timestamp: 0
JMS expiration: 0
JMS priority: 4
JMS delivery mode: 2
JMS reply to: null
JMS Redelivered: false
JMS Destination: 'q'/None; None
JMS Type: null
JMS MessageID: null
JMS Content-Type: text/plain
AMQ message number: 3
Properties:<NONE>
-------------------------------

It appears the java client can't see the properties in the perl message. 
However, if I spout with perl and drain with python, the properties are there.

cd /usr/share/doc/perl-qpid-0.22/examples
./spout.pl -P foo=bar --content "perl message" q

cd /usr/share/doc/python-qpid-0.22/example/api
./drain q
Message(user_id='', correlation_id='', properties={'x-amqp-0-10.routing-key': u'q', u'foo': 'bar'}, content=u'perl message')
Comment 8 Rajith Attapattu 2013-08-07 09:41:55 EDT
You need to set the encoding to "utf8" for it to be encoded as a String on the wire. Otherwise it will be sent as vbin.

Unless it's encoded as a String the java client will not interpret it as a String.
Comment 9 Darryl L. Pierce 2013-08-09 16:30:48 EDT
This is fixed upstream in r1512482:

http://svn.apache.org/viewvc?view=revision&revision=1512482

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