paho.mqtt.java icon indicating copy to clipboard operation
paho.mqtt.java copied to clipboard

There is a delay of 15 to 18 mins in getting the disconnect event notification from paho library in case of network disconnection behind a network proxy.

Open karanberiwal opened this issue 4 years ago • 6 comments

There is a delay of 15 to 18 mins in getting the disconnect event notification from paho library in case of network disconnection behind a network proxy. Once the network goes off, the connectionLost method is invoked after a delay of 17 minutes. Please need help on this

karanberiwal avatar Aug 17 '21 06:08 karanberiwal

The Paho Python client doesn't have a connectionLost method. I presume you're using the Paho Java client - I'll transfer the issue there.

ralight avatar Aug 17 '21 10:08 ralight

I have the same issue, there is a delay of 15 to 20 minutes depending of the network architecture. In fact I'm not able to reproduce this issue when I want to. I noticed that the connected() method works well. So I've done a work around with this and do not use the connectionLost callback anymore. This issue could be the same as this one. This issue appears depending on the environment where the code runs.

MartinMeyer1 avatar Oct 13 '21 06:10 MartinMeyer1

When the client is in the state where the connected() == false, the connectionLost() has not already been called and I call connect(), an exception is thrown: Exception during connect: org.eclipse.paho.client.mqttv3.MqttException: Client is currently disconnecting This might help

MartinMeyer1 avatar Oct 13 '21 11:10 MartinMeyer1

I think this issue is located somewhere in the ClientComms class.

MartinMeyer1 avatar Oct 13 '21 13:10 MartinMeyer1

I still can't comment on this, but wanted to check that it isn't that the client has a high keepalive value? keepalive of 500 seconds would mean the client considers the broker to have gone by 1000 seconds, which is near enough 17 minutes.

ralight avatar Oct 13 '21 14:10 ralight

The keepalive value is 60 seconds in my case

MartinMeyer1 avatar Oct 14 '21 06:10 MartinMeyer1