Camel PAHO routes not receiving offline messages while connecting back

蹲街弑〆低调 提交于 2021-01-29 19:13:52

问题


I'm using apache camel xml based paho routes for the subscription, publication process. While online, everything works fine. But I'm not able to receive the offline message.

I have set the following.,

  1. Constant Client ID
  2. Clean Session is FALSE,
  3. Both subscribed & published with QoS 2

With the standalone Program, it's getting all the offline messages. With the camel route it's not happening.


回答1:


Finally, I was able to solve this one manually.

Camel PAHO Client is not populating the callback function before performing the broker connection. They are doing it only when the connection is made.

So, once the connection is success then the broker just sends all the offline messages. In this case, our client does not have callback handlers to handle these messages. So they are lost.

Other clients (IoThub Client) which uses the PAHO internally is doing it right by setting the callback and initiating the connection.



来源:https://stackoverflow.com/questions/56248757/camel-paho-routes-not-receiving-offline-messages-while-connecting-back

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