mqtt客户端频繁中断,提示retrying....

2018-07-19 11:00:13.986 [MQTT Rec: c1] ERROR [org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter:316] [,] - Lost connection:已断开连接; retrying...

  造成这种情况的原因是ClientId相同。

  2个服务端使用相同的ClientId连接mqtt服务器,

  解决方案:

  让消费端的ClientId为随机字符串。这样ClientId就不会重复。

mqtt.consumer.client-id=${random.value}

  

猜你喜欢

转载自blog.csdn.net/zhen_6137/article/details/81112042