feat():修复MQTT连接,接收rabbitMq数据消费,拿到数据解析投递kafka

dev.analysis
LQS 2024-10-12 11:09:14 +08:00
parent 15bcd34b07
commit 1631a7cae8
1 changed files with 4 additions and 4 deletions

View File

@ -53,10 +53,10 @@ public class MqttClientService {
}
private void connectAndSubscribe(MqttProperties mqttProperties) throws MqttException, IOException {
// if (sampleClient != null && sampleClient.isConnected()) {
// log.info("MQTT客户端已经连接跳过重新连接。");
// return;
// }
if (sampleClient != null && sampleClient.isConnected()) {
log.info("MQTT客户端已经连接跳过重新连接。");
return;
}
sampleClient = new MqttClient(mqttProperties.getBroker(), mqttProperties.getClientId());
MqttConnectOptions connOpts = new MqttConnectOptions();