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
Per-subject limits for MQTT retained messages #4199
Conversation
Still need to handle migrating the old streams to the new subjects before review is needed. |
567077c
to
cd23f51
Compare
@neilalexander I made some changes because running a manual test I noticed that messages would not be received after the transfer. See comments on my commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, change was good but there was an issue with not refreshing the stream info after transfer. I am posting an LGTM here for your code, but please review my changes too.
@kozlovic Thanks for the review and the fixes! I've taken a look over your commit and it makes sense and looks fine to me — I had missed the need to call |
Signed-off-by: Neil Twigg <neil@nats.io>
Signed-off-by: Neil Twigg <neil@nats.io>
Signed-off-by: Neil Twigg <neil@nats.io>
I was running a manual test moving from dev to this branch and noticed that the consumer would receive only 1 message of the 10 messages sent as retained. So I modified the test to verify that we receive them all and we did not. The reason was that after the transfer we need to refresh the state of the stream (stream info) since we attempt to load all messages based on the state's sequences. I have also modified a bit the code to update the MaxMsgsPer once all messages have been transferred. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
83a128c
to
a744cb8
Compare
By publishing retained messages on their own subject, we can apply max messages per subject limits to them. Also include the domain name in the subject to make consistent with the other MQTT streams.
Signed-off-by: Neil Twigg neil@nats.io