Browse Source

修改mqtt代码

tags/V1.0.1^2
wanjing 1 year ago
parent
commit
9cd77d795c
5 changed files with 7 additions and 7 deletions
  1. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mqtt/MqttProviderConfig.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml
  3. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-local.yml
  4. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-prod.yml
  5. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-test.yml

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mqtt/MqttProviderConfig.java View File

@@ -1,6 +1,5 @@
package com.tuoheng.admin.mqtt;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tuoheng.admin.mqtt.consumer.MqttConsumerCallBack;
import com.tuoheng.common.core.utils.IpUtils;
import lombok.extern.slf4j.Slf4j;
@@ -75,8 +74,9 @@ public class MqttProviderConfig {
client.setCallback(new MqttConsumerCallBack());
client.connect(options);

client.subscribe("$share/g1/v1/298dd766/environment/message", 0);

String topic = "/v1/298dd766/environment/message";
log.info("拓恒大气监测系统,订阅:topic={}", topic);
client.subscribe(topic, 0);
} catch (MqttException e) {
e.printStackTrace();
}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml View File

@@ -115,7 +115,7 @@ spring:
password: public
#客户端id(不能重复)
client:
id: tuoheng-airmonitor-consumer-id
id: tuoheng-airmonitor-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
default:
topic: topic

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-local.yml View File

@@ -126,7 +126,7 @@ spring:
password:
#客户端id(不能重复)
client:
id: tuoheng-airmonitor-consumer-id
id: tuoheng-airmonitor-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
default:
topic: topic

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-prod.yml View File

@@ -115,7 +115,7 @@ spring:
password: admin##123
#客户端id(不能重复)
client:
id: tuoheng-airmonitor-consumer-id
id: tuoheng-airmonitor-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
default:
topic: topic

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-test.yml View File

@@ -116,7 +116,7 @@ spring:
password: admin##123
#客户端id(不能重复)
client:
id: tuoheng-airmonitor-consumer-id
id: tuoheng-airmonitor-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
default:
topic: topic

Loading…
Cancel
Save