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

MQTT5: support multiple Subscription ID properties #10734

Merged
merged 3 commits into from
Oct 30, 2020

Conversation

paul-lysak
Copy link
Contributor

Motivation:

Subscription ID property of the PUBLISH message may be repeated multiple times, which wasn't taken into account when developing MqttProperties API.

Modification:

Store Subscription ID properties separately from others - in MqttProperties.subscriptionIds.
Add MqttProperties.getProperties method to retrieve properties that may be repeated.
Change internal representation of User Properties for uniformity with Subscription ID - now they're stored in MqttProperties.userProperties rather than the common hash map.

Result:

Multiple Subscription ID properties can be set or retrieved.

@netty-bot
Copy link

Can one of the admins verify this patch?

@paul-lysak
Copy link
Contributor Author

Also, now I think that introducing MqttProperties.UserProperties class to wrap multiple occurrences of MqttProperties.UserProperty was a bad idea. If MqttProperties.listAll returned a collection of MqttProperty instead, MqttProperties.getProperty returned first occurence of UserProperty and in order to retrieve multiple properties users would need to call MqttProperties.getProperties (introduced in this PR) we would have a cleaner API.
However, the changes are already released and I'm not sure if it's OK to change the way properties behave now.

@normanmaurer
Copy link
Member

@netty-bot test this please

@paul-lysak thats right we can not break the API anymore... This ship has sailed :/

@normanmaurer
Copy link
Member

@netty-bot test this please

Copy link
Contributor

@chrisvest chrisvest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits, but looks fine.

@normanmaurer
Copy link
Member

@netty-bot test this please

@normanmaurer normanmaurer merged commit 7b736a3 into netty:4.1 Oct 30, 2020
@normanmaurer normanmaurer added this to the 4.1.54.Final milestone Oct 30, 2020
normanmaurer pushed a commit that referenced this pull request Oct 30, 2020
Motivation:

Subscription ID property of the PUBLISH message may be repeated multiple times, which wasn't taken into account when developing `MqttProperties` API.

Modification:

Store Subscription ID properties separately from others - in `MqttProperties.subscriptionIds`. 
Add `MqttProperties.getProperties` method to retrieve properties that may be repeated.
Change internal representation of User Properties for uniformity with Subscription ID - now they're stored in `MqttProperties.userProperties` rather than the common hash map.

Result:

Multiple Subscription ID properties can be set or retrieved.
raidyue pushed a commit to raidyue/netty that referenced this pull request Jul 8, 2022
Motivation:

Subscription ID property of the PUBLISH message may be repeated multiple times, which wasn't taken into account when developing `MqttProperties` API.

Modification:

Store Subscription ID properties separately from others - in `MqttProperties.subscriptionIds`. 
Add `MqttProperties.getProperties` method to retrieve properties that may be repeated.
Change internal representation of User Properties for uniformity with Subscription ID - now they're stored in `MqttProperties.userProperties` rather than the common hash map.

Result:

Multiple Subscription ID properties can be set or retrieved.
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.

4 participants