How to send plain text JmsMessage with empty header

江枫思渺然 提交于 2019-12-13 02:56:14

问题


I want to send a message to an activeMQ and receive it via MQTT.js in the frontend.

jmsTemplate.convertAndSend("topic", "Hello World!");

I am getting the message, but with a header, that I can not decode.

S�A S�)�x-opt-jms-destQ�x-opt-jms-msg-typeQ Ss�   f    
�/ID:myID@�topic://myTopic@@@@�  j��< St�e Sw�  Hello World!

Now I am trying to remove the header from my message.

This thread mentions the targetClient property, but this doesn't seam to work with a topic: Spring JMS Template - remove RFH Header information

I also found the MessageBuilder, where I should be able to set an empty header, but this MessageBuilder doesn't work with the jmsTemplate. jmsTemplate only supports the MessageCreator, which doesn't support an empty header.

How can I send a JMS Message in plain text without any header?

Thanks for any suggestions.


回答1:


Updating the Queue Broker to work with JMS2 fixed this issue.



来源:https://stackoverflow.com/questions/56340914/how-to-send-plain-text-jmsmessage-with-empty-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!