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

Bad behavior with packet size limitation

Open
#987 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

Please fill out the form below before submitting, thank you!

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

With MQTTv5 the client can set during the Connect the maximum size that the broker can send to it. In return, the broker informs in the Connack of the maximum size that the client can send to it.

It looks like Paho mixes up these 2 values and prevents the client from emitting packets larger than what was specified in the Connect and disconnects the client if it trie to sent a bigger packet.

The reported exception is:
>03/03/2023 14:05:17.379 org.eclipse.paho.mqttv5.client.internal.CommsSender SEVERE: clientId-pub2: exception
Outgoing packet too large. (51002)
> at org.eclipse.paho.mqttv5.common.ExceptionHelper.createMqttException(ExceptionHelper.java:25)
> at org.eclipse.paho.mqttv5.client.wire.MqttOutputStream.write(MqttOutputStream.java:83)
> at org.eclipse.paho.mqttv5.client.internal.CommsSender.run(CommsSender.java:145)
> at java.base/java.lang.Thread.run(Thread.java:829)

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.