Camel PAHO 路由在连接回时未收到离线消息 [英] Camel PAHO routes not receiving offline messages while connecting back

查看:67
本文介绍了Camel PAHO 路由在连接回时未收到离线消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用基于 apache camel xml 的 paho 路由进行订阅、发布过程.在线时,一切正常.但是我无法接收离线消息.

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. 固定客户 ID
  2. 清除会话为假,
  3. 两者都订阅了使用 QoS 2 发布

使用独立程序,它可以获取所有离线消息.骆驼路线不会发生这种情况.

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

推荐答案

最后,我能够手动解决这个问题.

Finally, I was able to solve this one manually.

Camel PAHO 客户端在执行代理连接之前未填充回调函数.他们只有在建立连接时才会这样做.

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.

在内部使用 PAHO 的其他客户端(IoThub 客户端)通过设置回调和启动连接来正确地做到这一点.

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

这篇关于Camel PAHO 路由在连接回时未收到离线消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆