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

MQTT Consumer: persistent session is not working because of random clientId #797

Closed
noonowl71 opened this issue Mar 6, 2016 · 3 comments · Fixed by #804
Closed

MQTT Consumer: persistent session is not working because of random clientId #797

noonowl71 opened this issue Mar 6, 2016 · 3 comments · Fixed by #804
Labels
bug unexpected problem or unintended behavior

Comments

@noonowl71
Copy link

I'm trying to set up a MQTT subscription with QOS 2 (mosquitto broker), which means the broker should keep messages when subscriber is offline, and send all stored messages when the subscriber becomes online.

Well, this is not working because Telegraf uses a random clientId to connect to the broker, and this causes that the persistent session is different every time it connects. From the mosquitto docs:

Badly designed clients may set clean session to false whilst using a randomly generated client id.

I think the best is to create a config option to override the clientId

@noonowl71 noonowl71 changed the title MQTT Consumer: persistent session is not working because on random clientId MQTT Consumer: persistent session is not working because of random clientId Mar 6, 2016
@sparrc sparrc added the bug unexpected problem or unintended behavior label Mar 6, 2016
@sparrc
Copy link
Contributor

sparrc commented Mar 6, 2016

yep, that's a bug, thanks for the report

@sparrc
Copy link
Contributor

sparrc commented Mar 7, 2016

it's worth noting that we're also setting clean session to true currently, so they wouldn't be delivered anyways.

We probably need to provide an option to set clean option to false and specify the client ID. (if clean option is set to false user must specify a client ID)

@noonowl71
Copy link
Author

That should do it, thanks!

geodimm pushed a commit to miketonks/telegraf that referenced this issue Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants