Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.14 MessageId not limited to 65535 #585

Closed
hylkevds opened this issue Feb 25, 2021 · 2 comments
Closed

0.14 MessageId not limited to 65535 #585

hylkevds opened this issue Feb 25, 2021 · 2 comments

Comments

@hylkevds
Copy link
Collaborator

Expected behavior

Generated message IDs are, as per the MQTT specification, always in the 1 - 65535 range.

Actual behavior

Message IDs go over 65535.

Once the messages tick over, the ID in the packet loops back to 0, but the ID expected in ACKs is still > 65535, resulting in the messages never being ACKed. The only reason this was not noticeable was the messages were only re-sent once (causing memory leaks)

Steps to reproduce

Have a stream of QOS 1 or 2 messages go to a client, wait for 65535 messages to pass.

Minimal yet complete reproducer code (or URL to code) or complete log file

https://github.com/hylkevds/moquetteTests/

Moquette MQTT version

0.14

hylkevds added a commit to FraunhoferIOSB/moquette that referenced this issue Feb 25, 2021
Message ID should always be in the range 1 - 65535. This adds a test,
and, and resets the counter to 1 when needed.
@supertick
Copy link

Hi,
I don't think this project is active ...
I had the same problem using moquette as an embedded broker ... solved it by changing netty config

      props.setProperty("netty.mqtt.message_size", "1048576");
      
      MemoryConfig mc = new MemoryConfig(props);
      Collections.singletonList(this);
      mqttBroker.startServer(mc, Collections.singletonList(this));

@hylkevds
Copy link
Collaborator Author

This issue is about the message Id not wrapping around back to 0 when hitting 65535, not about the size of the messages.

hylkevds added a commit to FraunhoferIOSB/moquette that referenced this issue May 9, 2021
Message ID should always be in the range 1 - 65535. This adds a test,
and, and resets the counter to 1 when needed.
hylkevds added a commit to FraunhoferIOSB/moquette that referenced this issue Jul 2, 2021
Message ID should always be in the range 1 - 65535. This adds a test,
and, and resets the counter to 1 when needed.
@andsel andsel closed this as completed in 06c64bf Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants