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

ClientID not sufficiently random #2

Open
jnovack opened this issue Jun 30, 2020 · 1 comment
Open

ClientID not sufficiently random #2

jnovack opened this issue Jun 30, 2020 · 1 comment
Labels
bug Something isn't working chore Chores and other boring cleanup

Comments

@jnovack
Copy link
Owner

jnovack commented Jun 30, 2020

Had two containers on swarm with the same client id (which MQTT does not like).

opts.SetClientID(fmt.Sprintf("%s_%v", goVersion.Application, time.Now().Unix()))

References:

@jnovack jnovack added bug Something isn't working chore Chores and other boring cleanup labels Jul 2, 2020
@dustin
Copy link

dustin commented Dec 16, 2022

If you're not planning to reuse the client ID, then you just don't need to supply one and allow the broker to generate one for you. If you're using mqtt v5, it'll tell you what it generated in case you want to resume a session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Chores and other boring cleanup
Projects
None yet
Development

No branches or pull requests

2 participants