eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.08k stars 879 forks source link

fix issues/873 #1039

Open alessandroAmedei opened 1 month ago

alessandroAmedei commented 1 month ago

Please make sure that the following boxes are checked before submitting your Pull Request, thank you!

fix #909 #873 #1005

Fixing the java docs of the method org.eclipse.paho.mqttv5.client.setSessionExpiryInterval(long)

Without calling this method with parameters greater than 0 or different from null, once the Network Connetion is closed, the broker will end immediatly the session even if the client is using cleanSession = false.

alessandroAmedei commented 1 month ago

To make sure that session is never deleted by broker:

connOpts.setSessionExpiryInterval((long) Integer.MAX_VALUE);