Bug 962461 - Unable to read the application headers of messages sent by the perl client using the JMS client
Summary: Unable to read the application headers of messages sent by the perl client us...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: perl-qpid
Version: 2.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-13 14:39 UTC by Petr Matousek
Modified: 2024-01-19 19:11 UTC (History)
1 user (show)

Fixed In Version: perl-qpid-0.22-5.el6, perl-qpid-0.22-5.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-4842 0 None None None Never
Apache JIRA QPID-4843 0 None None None Never
Apache JIRA QPID-5067 0 None None None Never

Description Petr Matousek 2013-05-13 14:39:15 UTC
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 21:16:55 UTC
(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 21:31:16 UTC
This fix for this is committed upstream:

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

Comment 3 Petr Matousek 2013-05-15 07:16:13 UTC
(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 13:12:56 UTC
(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 13:37:19 UTC
(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 14:40:00 UTC
(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 19:54:01 UTC
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 13:41:55 UTC
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 20:30:48 UTC
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.