Select to view content in your preferred language

Setting clientID in MQTT-Connector?

1837
3
Jump to solution
02-16-2021 01:58 AM
TimLeefmann
Emerging Contributor

We run a verneMQ broker that I want to connect to with the MQTT Input Connector. However, I can't establish a succesful connection.

Here the error message from the log:

Unexpected error during MQTT receiver initialization. org.eclipse.paho.client.mqttv3.MqttSecurityException: Bad user name or password at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:28) ~[?:?] at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:1040) ~[?:?] at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:151) ~[?:?] at java.lang.Thread.run(Thread.java:748) [?:?]

I succesfully tested the connection from the Geoevent Server using MQTT explorer with the same credentials, except for adding a clientID. The connector itself was similarly succesfully tested using "test.mosquitto.org" as a broker. Therefore I assume, the unsuccesful login may be caused by the missing clientID. Is there an option available that would allow me to supply a clientID using the Geovent MQTT Connector?

0 Kudos
1 Solution

Accepted Solutions
brudo
by
Occasional Contributor

I did some experimental changes in a local branch a few years ago, that I didn't ever publish to GitHub or submit as a pull request, as the project it was needed for did not materialize. Among other things, it added a property predefClientId, along with several other properties that define behavior on disconnect / reconnect. I'm not sure what state it was in when I left off, but I'll look it over and see about publishing it to my fork.

View solution in original post

3 Replies
brudo
by
Occasional Contributor

I did some experimental changes in a local branch a few years ago, that I didn't ever publish to GitHub or submit as a pull request, as the project it was needed for did not materialize. Among other things, it added a property predefClientId, along with several other properties that define behavior on disconnect / reconnect. I'm not sure what state it was in when I left off, but I'll look it over and see about publishing it to my fork.

TimLeefmann
Emerging Contributor

Would be great if you could share it. And good to know that this option is not included in the current connector.

0 Kudos
TimLeefmann
Emerging Contributor

Thanks for your help. As you suggested I added a property to the transporter for defining the ClientD (instead of generating one) and managed to succesfully receive a message from our mqtt broker.