moquette-io / moquette

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

Handle will delay interval and MQTT5's Will optional properties #770

Closed andsel closed 8 months ago

andsel commented 11 months ago

Release notes

Handle will delay interval property and update Will attributes for MQTT5 specification

What does this PR do?

Create a DelayQueue to track all the Will specifications that should be fired after a delay interval. It creates a scheduled task tuns every second and pull out of the queue the expired items. The items are Will instances contained in a Tracker instance. The Tracker is in charge of handling the calculation of the delay between the instant they are created and the expected expiry instant, this is used by the DelayQueue to sort out the things, by expiration time. Introduce also the serdes (H2 DataTypes) for the Will to be stored and loaded in H2. During server restart the Will specification are reloaded.

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

Permit to the broker to be adherent to MQTT5 specification, and handling correctly the will delay interval passed in connect message.

How to test this PR locally

Related issues

Use cases

Screenshots

Logs