moquette-io / moquette

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

Unsubscribe shared subscriptions #799

Closed andsel closed 9 months ago

andsel commented 9 months ago

Release notes

Implemented the unsubscribe for shared subscriptions.

What does this PR do?

Updates the CTrie.removeSubscriptionsFor to accept an UnsubscribeRequest instead of simple parameters, customizing the method to handle a shared subscription's unsubscribe request. Adds a method removeSharedSubscriptionsForClient to remove in one step all the shared subscriptions of a session, in doing so it introduces a mapping cache clientId -> list of subscription to avoid a full tree traversal.

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

Implements part of MQTT5 shared subscription feature

Checklist

Related issues