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

Implements management of receive_maximum parallel publishes the broekr can handle per client #852

Merged
merged 8 commits into from
Sep 15, 2024

Conversation

andsel
Copy link
Collaborator

@andsel andsel commented Sep 14, 2024

Release notes

Flow-control: implemented publish's quota management on the server side.

What does this PR do?

Update QoS1 and QoS2 management, at MQTTConnection level to handle the quota of parallel publishes that the broker receives from a client.
Updates the config classes to store and retrieve the value of receive_maximum setting, and use that value in CONNACK to the client. When the quota is consumed, on next publish of QoS1 and QoS2 the broker sends a DISCONNECT with 0x93 error code and close the connection.

Why is it important/What is the impact to the user?

Permit to the server to impose and respect a maximum parallel publishes it can handle per client, configurable in broker settings file. When the limit is passed it disconnects the client.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the Changelog if it's a feature or a fix that has to be reported

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

@andsel andsel self-assigned this Sep 14, 2024
…s class io.moquette.integration.mqtt5.TestUtils
Abstracts quota management in specialised classes (LimitedQuota and UnlimitedQuota)
Server's receives quota is a volatile attribute of the client's connection and is valued at connection time.
The value is defined in broker configuration, named `receive_maximum`.
@andsel andsel changed the title Feature/flow control Implements management of receive_maximum parallel publishes the broekr can handle per client Sep 15, 2024
@andsel andsel added the mqtt5 label Sep 15, 2024
@andsel andsel marked this pull request as ready for review September 15, 2024 09:54
@andsel andsel mentioned this pull request Sep 15, 2024
4 tasks
@andsel andsel merged commit bef139b into moquette-io:main Sep 15, 2024
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant