moquette-io / moquette

Java MQTT lightweight broker
http://moquette-io.github.io/moquette/
Apache License 2.0
2.32k stars 818 forks source link

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

Closed andsel closed 2 months ago

andsel commented 2 months ago

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

Author's Checklist

How to test this PR locally

Related issues