Skip to content
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

Added support for shared subscriptions #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pires22
Copy link

@pires22 pires22 commented Feb 27, 2023

No description provided.

@ThomasTJdev
Copy link
Collaborator

Interesting, thanks! I haven't used shared subscriptions myself. I can see that it's only available in the specification for x >= MQTT v5.0.

Would you be up for adding a simple test case in the tests/ directory?

I don't have time right now to do the testing, maybe @lmn or @lpapier would be up for it?


Direct link to MQTT v5.0 specification

3.2.2.3.13 Shared Subscription Available 42 (0x2A) Byte, Identifier of Shared Subscription Available.

Followed by a Byte field. If present, this byte declares whether the Server supports Shared Subscriptions. A value is 0 means that Shared Subscriptions are not supported. A value of 1 means Shared Subscriptions are supported. If not present, then Shared Subscriptions are supported. It is a Protocol Error to include the Shared Subscription Available more than once or to send a value other than 0 or 1.

If the Server receives a SUBSCRIBE packet containing Shared Subscriptions and it does not support Shared Subscriptions, this is a Protocol Error. The Server uses DISCONNECT with Reason Code 0x9E (Shared Subscriptions not supported) as described in section 4.13.

@pires22
Copy link
Author

pires22 commented Feb 27, 2023

Sure, I will work on it!

Shared subscriptions are available on mqtt 5.0 brokers, but the clients don't need to be using mqtt 5.0

I only added support for it in the client part as you can see in the commit, I hope thats fine.

@ThomasTJdev
Copy link
Collaborator

Sure, I will work on it!

Shared subscriptions are available on mqtt 5.0 brokers, but the clients don't need to be using mqtt 5.0

I only added support for it in the client part as you can see in the commit, I hope thats fine.

Just a simple test case - both for testing in the future, and as a tutorial for users. That would be great!

Yes, that is absolutely fine - they are not interconnected in that regards. The repo is a little mixed in the current state as a binary-package and a library-package, and they should maybe have been splitted into two different repos...

@ThomasTJdev
Copy link
Collaborator

Hi @pires22 - Up for adding a test case?

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

Successfully merging this pull request may close these issues.

2 participants