diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d81c42a5f8973b130f57233047018028b86c26d..428d39f612efd9dbe6429afd416d00c341384346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * **PROVISIONER** increase timeout for http requests [57](https://gitlab.com/itk.fr/lorhammer/issues/57) * **CHECKER** add mqtt checker [issues/50](https://gitlab.com/itk.fr/lorhammer/issues/50) +* **MQTT** fix bug : mosquitto refuse to talk to a client with clientId containing a / [issues/59](https://gitlab.com/itk.fr/lorhammer/issues/59) ## Version 0.4.0 - 2017-11-17 - [binaries](https://gitlab.com/itk.fr/lorhammer/tags/0.4.0) diff --git a/src/tools/mqtt.go b/src/tools/mqtt.go index 67750dbcbf51f4eff786700d5e29fc9d377c69c2..617c7184cabeb906e06442dc3357dc54e8bffd41 100644 --- a/src/tools/mqtt.go +++ b/src/tools/mqtt.go @@ -39,7 +39,8 @@ func NewMqtt(hostname string, consulClient Consul) (Mqtt, error) { return nil, err } - return NewMqttBasic(url, MqttStartTopic+"/"+hostname) + clientID := hostname + "_" + string(RandomBytes(8)) + return NewMqttBasic(url, clientID) } //NewMqttBasic return a Mqtt client