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

Topic alias and message expiry support in broker #616

Merged
merged 22 commits into from
May 29, 2023
Merged

Topic alias and message expiry support in broker #616

merged 22 commits into from
May 29, 2023

Conversation

swanandx
Copy link
Member

This PR adds support for MQTTv5 related features, topic alias and message expiry.

Topic alias

  • Allow clients to set and use topic alias
  • Broker can also set topic alias ( if supported by client ). If client specifies maximum topic alias to use, broker will use topic aliases for that client.

Message Expiry

  • Discard expired messages ( expired messaged mean time spent waiting >= message expiry interval )
  • before forwarding publish packets, update message expiry interval to original value - time spent

Type of change

New feature (non-breaking change which adds functionality)

Checklist:

  • Formatted with cargo fmt
  • Make an entry to CHANGELOG.md if its relevant of user of the library. If its not relevant mention why.

@swanandx swanandx mentioned this pull request May 18, 2023
19 tasks
rumqttd/src/router/routing.rs Show resolved Hide resolved
rumqttd/src/router/routing.rs Show resolved Hide resolved
rumqttd/src/router/routing.rs Outdated Show resolved Hide resolved
rumqttd/src/router/connection.rs Outdated Show resolved Hide resolved
rumqttd/src/router/connection.rs Outdated Show resolved Hide resolved
rumqttd/src/router/mod.rs Outdated Show resolved Hide resolved
rumqttd/src/router/logs.rs Show resolved Hide resolved
rumqttd/src/router/logs.rs Show resolved Hide resolved
rumqttd/src/router/logs.rs Outdated Show resolved Hide resolved
rumqttd/src/router/logs.rs Show resolved Hide resolved
rumqttd/src/router/routing.rs Outdated Show resolved Hide resolved
rumqttd/src/link/remote.rs Show resolved Hide resolved
rumqttd/src/router/connection.rs Outdated Show resolved Hide resolved
rumqttd/src/router/connection.rs Outdated Show resolved Hide resolved
rumqttd/src/router/logs.rs Show resolved Hide resolved
rumqttd/src/router/mod.rs Show resolved Hide resolved
rumqttd/src/router/routing.rs Show resolved Hide resolved
rumqttd/src/router/routing.rs Show resolved Hide resolved
Copy link

@h3nill h3nill left a comment

Choose a reason for hiding this comment

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

i don't really like that fact that we are deriving the fact if a particular client is a v4 or v5 from assumptions and if some variable are Some or None. But i think that's the best we can do with current design.

left one small comment other than that LGTM.

rumqttd/src/router/routing.rs Outdated Show resolved Hide resolved
@mnpw mnpw merged commit 7a4b895 into main May 29, 2023
@swanandx swanandx deleted the tame branch July 28, 2023 09:11
carlocorradini pushed a commit to carlocorradini/rumqtt that referenced this pull request Aug 3, 2023
* feat: store properties and expiry in logs

* feat: ignore expired messages

* fix: checking expired messages

* feat: broker handling topic alias

* feat: set message expiry interval to received value minus time spent waiting

* fix: case when time spent is equal to message expiry interval

* feat: broker can set topic alias for clients to use

* feat: send disconnet packets to client

* feat: using let-else instead of if-let

* feat: entry in CHANGELOG

* fix: declare topic in outer scope

* fix: missing argument for Link

* feat: include Reason in disconnection message

* feat: handle tenant prefix properly while forwarding, check max_alias explicitly

* feat: make broker_topic_alias optional

* feat: validate and set topic alias in separate fn

* feat: comments regarding last will and storage

* feat: extract all broker topic alias related things to separate struct

* feat: improve readability for message expiry

* feat: typos and todo

* feat: ignore connack properties in v4

* feat: rename topic_alias_exists to topic_alias_already_exists
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.

3 participants