Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove content-length header attribute from MapMessage #7

Closed

Conversation

henning-gerhardt
Copy link
Contributor

Sending a map message from PHP to a Java based consumer via ActiveMQ failes because of superfluous content-length attribute in header information. ActiveMQ uses content-length attribute to distinguish ByteMessages from other messages (TextMessage or MapMessage) as described in Stomp implementation on ActiveMQ.

@treyhyde
Copy link
Contributor

treyhyde commented Sep 1, 2015

Do you have a case this isn't working. Your example was our exact example why we added this as a Bytes message. If any of your data in your map has a NULL (\0) character, your map will not be delivered. Are you hitting a case where the content-length presented is not correct?

@henning-gerhardt
Copy link
Contributor Author

Content-length is always correct. The problem is that ActiveMQ (5.11.0 and 5.12.0) threats this MapMessage as a ByteMessage if content-length is present.

Why should there be a NULL character inside MapMessage - it's JSON encoded.

And why then has TextMessage no content-length?

@treyhyde
Copy link
Contributor

Null characters happen naturally if you have some binary payload as a value in the map. I'll dig but we may no longer be using the map message and that's why we aren't seeing your problem.

@treyhyde
Copy link
Contributor

We're actively using Map messages with arbitrary input (may contain nulls), it would be unsafe to merge this. What version of ActiveMQ are you using where you are seeing this behavior?

@henning-gerhardt
Copy link
Contributor Author

As mentioned in my previuos post (Sep, 02) I could reproduce this with ActiveMQ 5.11.0 and 5.12.0.

@henning-gerhardt henning-gerhardt deleted the MapMessageFix branch October 17, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants