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

Mosquitto mqtt broker getting diconnected due to same clienId for more than one mosquitto #2892

Open
rahulpandey-98 opened this issue Sep 12, 2023 · 2 comments

Comments

@rahulpandey-98
Copy link

I have made a template for mosquitto mqtt broker to connect to AWS IoT using the information provided on
https://aws.amazon.com/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/

I have created a template to launch mosquitto instances through autoscaling. When two instances are created, one of the instance getting disconnected automatically. I am assuming the reason to be issue with client_id. As client_id is same for both the instances, so while using more than instance with same client_id, one of the mosquitto broker is getting disconnected.

I have following queries:
1. How to configure client_id dynamically so that for each instance launched through autoscaling have a distinct client_id?
2. If reason for disconnecting is something else then please let me know.

@ralight
Copy link
Contributor

ralight commented Sep 12, 2023

You could try leaving the bridge client id unset, then it would be decided by the remote broker.

@NorbertHeusser
Copy link
Contributor

Not sure, if AWS IoT does allow connections without a clientid. If AWS IoT does require a clientid you would need to generate one in your autoscaling script (e.g generate a UUID).

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

No branches or pull requests

3 participants