Catch-up missed messages

夙愿已清 提交于 2019-12-12 02:58:22

问题


As far as my understanding goes, when a message is published to a topic, it is received by only the clients currently subscribed to that topic. If a client turns up after the message is published, it won't receive that message.

Suppose a client is disconnected momentarily, is there a way to help the client catch-up with the messages missed when it is connected again?

Thanks


回答1:


If a client subscribes to a topic then the connection to the broker is dropped, the client will need to reconnect.

As long as client sets the cleanSession=false flag on the connection and resubscribes to the same topics the broker should replay any missed messages.

A more detailed description of durable subscriptions can be found here:

http://www.hivemq.com/mqtt-essentials-part-7-persistent-session-queuing-messages/

and here:

http://www.thingsprime.com/?p=2897



来源:https://stackoverflow.com/questions/30953138/catch-up-missed-messages

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