Open hylkevds opened 1 year ago
In our internal version I made a hack to implement this: https://github.com/FraunhoferIOSB/moquette/commit/3756936b842ea75508fef6a2fc7f4df767334fa4 Definitely not the cleanest way, but may be of use for inspiration.
The tricky bit is getting the unsubscribe notification to the interceptor, since the PostOffice is not involved, since there is no unsubscribe message. In my hack I solved this by giving the SessionRegistry
a reference to the interceptor.
When a session is cleaned up, active subscriptions are not removed from the
CTrieSubscriptionDirectory
repository. This is a memory leak and causes unnecessary processing when the broker tries to send messages to these phantom subscriptions.When subscriptions are cleaned up for expired sessions the interceptor should also be notified of this.