Commit 329ab0ac authored by suhuiguang's avatar suhuiguang

refeat(jg): 3库数据刷新

1.优化mqtt主题
parent de1be85c
package com.yeejoin.amos.boot.module.jg.biz.refresh.adapter; package com.yeejoin.amos.boot.module.jg.biz.refresh.adapter;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -18,8 +19,6 @@ public class Emq2DataRefreshEvent extends EmqxListener { ...@@ -18,8 +19,6 @@ public class Emq2DataRefreshEvent extends EmqxListener {
private final EmqKeeper emqKeeper; private final EmqKeeper emqKeeper;
@Value("${data.refresh.tp:data/refresh/+/+}")
private String dataRefreshTp;
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String applicationName; private String applicationName;
...@@ -36,7 +35,8 @@ public class Emq2DataRefreshEvent extends EmqxListener { ...@@ -36,7 +35,8 @@ public class Emq2DataRefreshEvent extends EmqxListener {
@PostConstruct @PostConstruct
void init() throws Exception { void init() throws Exception {
emqKeeper.subscript(this.buildShareTopic(dataRefreshTp), 2, this); String topic = TZSCommonConstant.DATA_REFRESH_TOPIC.replace("%s", "+");
emqKeeper.subscript(this.buildShareTopic(topic), 2, this);
} }
private String buildShareTopic(String topic) { private String buildShareTopic(String topic) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment