|
@@ -88,7 +88,6 @@ func (M *MQTTBrokerNode) Init(ctx ruleEngine.Context, config string) error {
|
|
|
M.mqttClient = c
|
|
|
go func() {
|
|
|
if token := c.Connect(); token.Wait() && token.Error() != nil {
|
|
|
- fmt.Println(token.Error().Error())
|
|
|
return
|
|
|
}
|
|
|
}()
|
|
@@ -122,6 +121,7 @@ func (M *MQTTBrokerNode) OnMessage(ctx ruleEngine.Context, message *protocol.Mes
|
|
|
}
|
|
|
topic := stringBuf.String()
|
|
|
token := M.mqttClient.Publish(topic, 0, false, message.Data)
|
|
|
+ fmt.Printf("+++++++++++++++%v\r\n", M.mqttClient)
|
|
|
if token.Error() != nil {
|
|
|
ctx.TellNext(message, protocol.Failure)
|
|
|
} else {
|