|  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
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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
38 - 31 = ?
Subscribe to this entry?

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

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: and here: 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.


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

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-17 22:31 UTC]
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.


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]
-Assigned To: +Assigned To: gena01
 [2017-10-24 07:05 UTC]
-Status: Assigned +Status: Open -Assigned To: gena01 +Assigned To:
 [2021-08-06 16:05 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-06 16:05 UTC]
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: Sat May 18 07:01:33 2024 UTC