0
votes

I am trying Python stomp client to send a binary message to JVM via ActiveMQ and I need it as JMS BytesMessage, but it comes as TextMessage.

I would imagine it should be possible, as I can do the opposite (JVM to Python), but not sure how.

Anyone knows the trick?

2

2 Answers

2
votes

You need to set the content-length header on the STOMP message you send in order for it to be translated into a JMS BytesMessage. See the "Working with JMS Text/Bytes Messages and Stomp" section of the ActiveMQ STOMP documentation.

0
votes

stomp.Connection.send() always specifies content-length header. You need to add stomp.Connection(auto_content_length=False), Because the default is stomp.Connection(auto_content_length=True) which specifies the content-length header only for bytes messages and not for string messages.