Add content-length header only for messages containing zero byte#8
Open
vitalif wants to merge 2 commits intophp:masterfrom
Open
Add content-length header only for messages containing zero byte#8vitalif wants to merge 2 commits intophp:masterfrom
vitalif wants to merge 2 commits intophp:masterfrom
Conversation
Allows OpenMQ/ActiveMQ to correctly map messages to JMS TextMessages instead of only BytesMessages. Fixes https://bugs.php.net/bug.php?id=70280
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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! :)
This pull request fixes this behaviour by making php5-stomp only add content-length header for messages with zero byte.
(https://bugs.php.net/bug.php?id=70280)