How to Produce from MQTT and consume as MQTT and JMS in ActiveMQ

最后都变了- 提交于 2019-12-05 20:00:54

Your problem looks to be that your JMS consumer is expecting the messages to arrive as a TextMessage which is a false assumption when dealing with MQTT produced messages.

MQTT messages are binary with no content type information or headers to define the payload. For that reason the broker will always interpret them as a BytesMessage and dispatch them as such. You will need to code for that fact and consume BytesMessage as well, and then read the payload out as a String.

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