Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Broker should store also subscriptions with QoS 0 #693

Closed
mitsos1os opened this issue Oct 19, 2017 · 7 comments
Closed

Broker should store also subscriptions with QoS 0 #693

mitsos1os opened this issue Oct 19, 2017 · 7 comments

Comments

@mitsos1os
Copy link
Contributor

According to documentation found throughout the internet, there are two separate things to store in the broker when clients uses persistent connection. The messages and the subscriptions of the client.
However even though the messages have to be send with QoS > 0 in order to be persisted, the subscriptions should be directly persisted when clean flag is false as stated in https://www.hivemq.com/blog/mqtt-essentials-part-7-persistent-session-queuing-messages in So what will be stored in the session? section

But this is not the case here, because every persistence factory used in mosca, in storeSubscriptions function, explicitly filters out subscriptions with QoS <= 0. Like here This also occurs in other factories...

So for example this has conflicts with the case where I actually do not want any messages to be persisted (sent with QoS 0) but there should be no need to re subscribe the client for every reconnect to the topics that accept these messages...

@mcollina
Copy link
Collaborator

This is very likely a won't fix situation.

https://github.com/mcollina/aedes should be more conformant to the spec. Use that one.

@mitsos1os
Copy link
Contributor Author

I am willing to submit a pull request for that... But could you please tell me what is the state of the aedes project? Is it stable and fully compatible with Mosca? Because I do not see any migration guide?

@mcollina mcollina reopened this Oct 19, 2017
@mcollina
Copy link
Collaborator

Of course, a PR is welcome.

Aedes is more performant than Mosca, and in some cases more stable than Mosca. It's not 100% API compatible, but the approach is similar. All active development happens there, as messing with the internals here is too complicated.

In the future, aedes will be integrated here.

@mitsos1os
Copy link
Contributor Author

I have just submitted the PR... Could you give me a quick guide (also I believe this should be written to aedes guide), as of how Mosca is (or not) one way compatible with Aedes. So what functionality / API used in mosca is now different in aedes.

@mcollina
Copy link
Collaborator

The API is different but you should be able to migrate 1-1.

@mitsos1os
Copy link
Contributor Author

Please check the Travis buils on the PR. They fail due to MongoDB package signature error.

Also from a quick look into aedes-persistence-mongodb it seems that you also skip restoring of QoS 0 subscriptions... Take a look here

@mcollina
Copy link
Collaborator

That is a bug in the aedes mongodb persistence. The “main” one is correct and restores them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants