8000 MQTT: Resubscribe after a reconnect by maciejsszmigiero · Pull Request #3452 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MQTT: Resubscribe after a reconnect #3452

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

Merged
merged 2 commits into from
May 2, 2020
Merged

MQTT: Resubscribe after a reconnect #3452

merged 2 commits into from
May 2, 2020

Conversation

maciejsszmigiero
Copy link
Contributor

After losing our connection to a MQTT broker our subscription will be gone, too, so we need to subscribe to our topic once again after reconnecting, otherwise collectd will not receive any MQTT messages any more.

ChangeLog: MQTT plugin: Resubscribe after a reconnect
Fixes: #3442

@maciejsszmigiero maciejsszmigiero requested a review from a team as a code owner May 1, 2020 18:17
@maciejsszmigiero
Copy link
Contributor Author

clang-format issues are outside the code parts affected by this change so they won't fit this PR very well.

Copy link
Member
@octo octo left a comment

Choose a reason for hiding this comment

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

Hi @maciejsszmigiero,

thank you very much for your PR! I think introducing a wrapper around mosquitto_subscribe() makes the code unnecessarily verbose. What do you think?

Best regards,
—octo

@octo
Copy link
Member
octo commented May 1, 2020

clang-format issues are outside the code parts affected by this change so they won't fit this PR very well.

Just put those cosmetic fixes in a separate commit – the check doesn't negotiate ;)

@maciejsszmigiero
Copy link
Contributor Author

Thanks for your quick review Florian, will add a comment fixing the clang-format reported things in a respin.

After losing our connection to a MQTT broker our subscription will be gone,
too, so we need to subscribe to our topic once again after reconnecting,
otherwise collectd will not receive any MQTT messages anymore.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
This is an automated code style fix generated by running
"contrib/format.sh src/mqtt.c".
No functional change intended.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Copy link
Member
@octo octo left a comment

Choose a reason for hiding this comment

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

@octo octo merged commit 5cd43eb into collectd:master May 2, 2020
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.

[mqtt] reconnect is not resubscribing to the queue
2 participants
0