Skip to content

feat(rumqttd): retained messages#683

Merged
swanandx merged 11 commits intomainfrom
retained-msg-fix
Aug 17, 2023
Merged

feat(rumqttd): retained messages#683
swanandx merged 11 commits intomainfrom
retained-msg-fix

Conversation

@swanandx
Copy link
Contributor

@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

@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
@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