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

Add possibility to set a custom MQTT client Id in VrpcAgent #56

Closed
cstim opened this issue Apr 29, 2022 · 3 comments · Fixed by #61
Closed

Add possibility to set a custom MQTT client Id in VrpcAgent #56

cstim opened this issue Apr 29, 2022 · 3 comments · Fixed by #61
Assignees
Labels
feature New feature or request

Comments

@cstim
Copy link
Contributor

cstim commented Apr 29, 2022

Is your feature request related to a problem? Please describe.
When the VrpcAgent object starts the MQTT connection, it also sets a MQTT client ID. This client ID is generated in the VrpcAgent.js code but cannot be set from the application code. Sometimes the application needs to set the MQTT client ID into some controlled string before the MQTT connection is established, so it should be possible to set this.

Describe the solution you'd like
Add an optional mqttClientId argument to VrpcAgent.serve(), or as option into the constructor.

Related: In VrpcClient there also isn't an argument or option, but the mqtt client id is set in the constructor as member variable this._mqttClientId already, so the application code can just modify that member variable before calling connect. Not particularly elegant, but works already.

@bheisen
Copy link
Collaborator

bheisen commented May 2, 2022

Yes, I believe that you are right. I will add the corresponding option, both for the agent and the client.

@bheisen
Copy link
Collaborator

bheisen commented May 2, 2022

I think I like the option in the constructor better and keep the serve() function free from any configuration. Will hence provide an own PR soonish. Thank you for your PR anyways!

@bheisen bheisen self-assigned this May 2, 2022
@create-issue-branch
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
2 participants