eclipse-paho / eclipse-paho/paho.mqtt.java

JavaDoc about sessionExpiryInterval in MQTT 5 client is incorrect

Open
#873 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
919
PR merge metrics
No merged PRs in 30d

Description

- [x] Bug exists Release Version 1.2.5 ( Master Branch)
- [ ] Bug exists in MQTTv3 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
- [X] Bug exists in MQTTv5 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)

The JavaDoc on `org.eclipse.paho.mqttv5.client.MqttConnectionOptions#setSessionExpiryInterval` states (in part):

> By default this value is null and so will not be sent, in this case, the session will not expire.

However [section 3.1.2.11.2 of the MQTT 5 specification](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901048) states:

> If the Session Expiry Interval is absent the value 0 is used. If it is set to 0, or is absent, the Session ends when the Network Connection is closed.
>
> If the Session Expiry Interval is 0xFFFFFFFF (UINT_MAX), the Session does not expire.

The JavaDoc on `org.eclipse.paho.mqttv5.client.MqttConnectionOptions#setSessionExpiryInterval` should be corrected to reflect the behavior defined in the specification. It would also probably be useful to make `org.eclipse.paho.mqttv5.common.packet.MqttDataTypes#FOUR_BYTE_INT_MAX` public and reference that in the JavaDoc as an easy way to ensure the session does not expire.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.