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}