php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70280 php5-stomp should NOT always add 'content-length' header
Submitted: 2015-08-16 12:55 UTC Modified: 2021-08-15 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: vitalif at mail dot ru Assigned: cmb (profile)
Status: No Feedback Package: stomp (PECL)
PHP Version: 5.6.12 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vitalif at mail dot ru
New email:
PHP Version: OS:

 

 [2015-08-16 12:55 UTC] vitalif at mail dot ru
Description:
------------
Hi!

Now php5-stomp always adds 'content-length' header to all messages being sent. This makes sending JMS "TextMessage" (including XML!) impossible, because most JMS/STOMP queues like OpenMQ or ActiveMQ decide whether the message is JMS "BytesMessage" or "TextMessage" based on the presence of 'content-length' header (as described here: http://activemq.apache.org/stomp.html and here: https://mq.java.net/4.4-content/stomp-funcspec.html). I.e. if it is there, the message is treated as bytes. So JMS can never decode messages sent from php5-stomp as XML, because it wants XML to be TextMessages.

And XML is obviously the thing that you want the most when connecting to a JMS queue via STOMP! :)

So, php5-stomp should provide a way to send messages WITHOUT content-length header. For example you may add a configuration parameter, or you can make the extension only add that header if the message does not contain zero byte.


Patches

php5-stomp-only-binary-content-length.diff (last revision 2015-08-18 09:05 UTC by vitalif at mail dot ru)

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-17 22:31 UTC] gena01@php.net
I have to think about this.

From the official stomp 1.1 documentation: 

SEND frames SHOULD include a content-length header and a content-type header if a body is present.

Link: https://stomp.github.io/stomp-specification-1.1.html#SEND

So looks like ActiveMQ might actually be violating the spec and not looking at content-type header or the documentation is wrong?
 [2015-11-17 22:31 UTC] gena01@php.net
-Assigned To: +Assigned To: gena01
 [2017-10-24 07:05 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: gena01 +Assigned To:
 [2021-08-06 16:05 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-06 16:05 UTC] cmb@php.net
Is this still an issue with latest stomp (2.0.2)?
 [2021-08-15 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC