-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
unable to unsubscribe topics after client disconnects #49
Comments
Just use What code are you using to achieve this? It should work even if it was not intended to be used that way. |
Yes, I am aware of that, but 'cleansession : true' will not hold messages if the client ungracefully disconnects which is something I would not want. |
Those would already be gone, as with the 'clientDisconnect' event the client has no live subscriptions (that is used for live subscriptions). At the moment, that fied is not part of the public API and it is used internally. I am fine in exposing this, but it would require a bit of work around doc and testing. The idea should be to have that flushed if the client is clean, but to maintain the state if the client is not clean. BTW, to achieve what you want, it might be simpler to hook into the persistence and delete them from there directly. If you want to send a PR, I will be happy to review. |
Hi mcollina, Could you please suggest me how to remove subscriptions completely from aedes. |
You must use the persistence api: https://github.com/mcollina/aedes-persistence (all persistences implement the same API). |
I tried using instancecleansubscription() method and I was able to completely remove clients subscriptions. |
Hi Mcollina,
I want to unsubscribe to all the topics a client has subscribed to when he disconnects. After I reconnect I should not get messages of those topics unless I subscribe again. In order to achieve this on 'clientDisconnect' and 'clientError' events I am trying to explicitly unsubscribe to the topics. However, on these events I am getting 'subscriptions' object of the client as empty. But when I connect again, I am getting back all subscriptions on the 'subscriptions' object.
PS: I am using cleansession: false on client. QOS: 1
The text was updated successfully, but these errors were encountered: