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

feat(rumqttd): retained messages #683

Merged
merged 11 commits into from
Aug 17, 2023
Merged

feat(rumqttd): retained messages #683

merged 11 commits into from
Aug 17, 2023

Conversation

swanandx
Copy link
Member

@swanandx swanandx commented Aug 15, 2023

This PR aims to bring support for retained messages in rumqttd.

Previously, we were appending the retained messages to datalog everytime a subscription was made. But as every client shares same datalog, this lead to client receiving multiple messages!

To fix this, we don't append messages to datalog, instead of that, we use a flag forward_retained_messages to indicate we still haven't forwarded the messages for a particular subscription. Once we read retained messages, we set this flag to false, which assures we only forward retained messages once!

Type of change

Bug fix (non-breaking change which fixes an issue)

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.

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.

few questions and suggestions

rumqttd/src/router/routing.rs Outdated Show resolved Hide resolved
rumqttd/src/router/routing.rs Outdated Show resolved Hide resolved
rumqttd/src/router/routing.rs Outdated Show resolved Hide resolved
rumqttd/src/router/routing.rs Outdated Show resolved Hide resolved
@swanandx swanandx marked this pull request as ready for review August 17, 2023 09:53
@swanandx swanandx changed the title feat(rumqttd): retained messages and retain forward rule feat(rumqttd): retained messages Aug 17, 2023
@swanandx swanandx merged commit 3577628 into main Aug 17, 2023
3 checks passed
@swanandx swanandx deleted the retained-msg-fix branch August 17, 2023 11:51
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