如何发送带有空标题的纯文本JmsMessage [英] How to send plain text JmsMessage with empty header
问题描述
我想发送消息到activeMQ并通过前端的MQTT.js接收它.
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
我还找到了MessageBuilder,应该可以在其中设置一个空标题,但是该MessageBuilder不适用于jmsTemplate. jmsTemplate仅支持MessageCreator,后者不支持空标题.
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.
我如何以纯文本形式发送无标题的JMS消息?
How can I send a JMS Message in plain text without any header?
谢谢您的建议.
推荐答案
更新队列代理以与JMS2一起使用可解决此问题.
Updating the Queue Broker to work with JMS2 fixed this issue.
这篇关于如何发送带有空标题的纯文本JmsMessage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!