feat():修复MQTT连接,接收rabbitMq数据消费,拿到数据解析投递kafka
parent
15bcd34b07
commit
1631a7cae8
|
@ -53,10 +53,10 @@ public class MqttClientService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void connectAndSubscribe(MqttProperties mqttProperties) throws MqttException, IOException {
|
private void connectAndSubscribe(MqttProperties mqttProperties) throws MqttException, IOException {
|
||||||
// if (sampleClient != null && sampleClient.isConnected()) {
|
if (sampleClient != null && sampleClient.isConnected()) {
|
||||||
// log.info("MQTT客户端已经连接,跳过重新连接。");
|
log.info("MQTT客户端已经连接,跳过重新连接。");
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
sampleClient = new MqttClient(mqttProperties.getBroker(), mqttProperties.getClientId());
|
sampleClient = new MqttClient(mqttProperties.getBroker(), mqttProperties.getClientId());
|
||||||
MqttConnectOptions connOpts = new MqttConnectOptions();
|
MqttConnectOptions connOpts = new MqttConnectOptions();
|
||||||
|
|
Loading…
Reference in New Issue