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

Implement topic alias management #873

Merged
merged 6 commits into from
Nov 26, 2024

Conversation

andsel
Copy link
Collaborator

@andsel andsel commented Nov 25, 2024

Release notes

Implemented handling of topic alias received by publishers. Doesn't implement the alias remapping in forwarded publishes.

What does this PR do?

Updates CONNACK to set topic alias maximum property if user explicitly configures topic_alias_maximum configuration setting.
Adds a topic alias to topic name cache to MQTTConnection, named TopicAliasMapping.
Updates PUBLISH processing to handled the incoming topic alias, checking the various error condition (respect to the specification), resolve the alias to topic name and forward processing of publish message with topic name and without topic alias.
Added unit tests to MQTTConnection to cover the feature.

Why is it important/What is the impact to the user?

Implements the topic alias feature defined in the specification of MQTT 5. It handles only for incoming publishes, it doesn't apply any technique to replace topic names with aliases on the forward to subscribers phase.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the Changelog if it's a feature or a fix that has to be reported

How to test this PR locally

Related issues

@andsel andsel added the mqtt5 label Nov 25, 2024
@andsel andsel self-assigned this Nov 25, 2024
@andsel andsel mentioned this pull request Nov 25, 2024
13 tasks
@andsel andsel marked this pull request as ready for review November 26, 2024 15:28
@andsel andsel merged commit facdc39 into moquette-io:main Nov 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Topic alias support
1 participant