|  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: 2017-10-24 07:05 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:
Status: Open Package: stomp (PECL)
PHP Version: 5.6.12 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: vitalif at mail dot ru
New email:
PHP Version: OS:


 [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:
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jul 27 06:01:24 2021 UTC