Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Reconnecting the Mqtt client after network failure - receives the previously received messages again
Reconnecting the Mqtt client after network failure - receives the previously received messages again [message #1751457] Tue, 10 January 2017 14:15 Go to next message
Kaveri Hindi is currently offline Kaveri HindiFriend
Messages: 5
Registered: January 2017
Junior Member
Hi All,

I am using paho for Mqtt connection
I have subscribed to few topics and I am able to receive the messages properly.

In case of poor network or no network, Mqtt connection is lost. So I am trying to reconnect to Mqtt with the same client and subscribe to the same topics.
After reconnecting I am receiving the previously received messages again. (last message on each topic)

I am hoping if its the previously connected client, It shouldn't receive the previously received messages again after reconnecting.

How should i handle this case if I don't want to receive the previously received messages.

I am not using any unique identifier for any messages recieved.

Hoping for a positive reply !
Thanks in advance


Re: Reconnecting the Mqtt client after network failure - receives the previously received messages a [message #1752000 is a reply to message #1751457] Tue, 17 January 2017 15:36 Go to previous messageGo to next message
James Sutton is currently offline James SuttonFriend
Messages: 69
Registered: July 2015
Member
Could it be that you are publishing the messages with the retain flag set? If you want messages to be retained, you will need to disable clean session when you reconnect your client.
Re: Reconnecting the Mqtt client after network failure - receives the previously received messages a [message #1752171 is a reply to message #1752000] Thu, 19 January 2017 12:46 Go to previous message
Kaveri Hindi is currently offline Kaveri HindiFriend
Messages: 5
Registered: January 2017
Junior Member
We want to ensure that messages are NOT re-delivered to the clients upon reconnection.
How do we ensure the same ? Either avoid redelivery or detect duplicates.

We are using configurations 1) Clean Session as false 2) with QOS = 1 3) retain flag to true. While reconnect also , we use the same client Id.
We have RabbitMq as the Mqtt broker.

Please guide how to avoid redelivery or detection of duplicates mqtt messages. Does QOS = 2 work with RabbitMq ?
Previous Topic:Lost messages using Paho
Next Topic:How to create QUEUES/TOPICS with Auto delete feature
Goto Forum:
  


Current Time: Mon Sep 24 20:54:17 GMT 2018

Powered by FUDForum. Page generated in 0.01879 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top