mqtt上传接口修改

This commit is contained in:
zhanghan11 2024-04-29 17:34:28 +08:00
parent 1e19aa556e
commit 7b0751bb24
3 changed files with 26 additions and 18 deletions

View File

@ -136,8 +136,8 @@ datasyn:
mqtt: mqtt:
host: tcp://111.11.4.77:15002 host: tcp://111.11.4.77:15002
clientId: tzipc clientId: tzipc
topicu: /usr/plcnet/roller/edge/u #数据上行主题 设备向服务器推送数据的主题 topicu: /usr/plcnet/youmotest/edge/u #数据上行主题 设备向服务器推送数据的主题
topicd: /usr/plcnet/roller/edge/d #数据下行主题 服务器向设备推送数据主题 topicd: /usr/plcnet/youmotest/edge/d #数据下行主题 服务器向设备推送数据主题
userName: taizhong userName: taizhong
password: 6IYC@A5By0l password: 6IYC@A5By0l
timeOut: 10 timeOut: 10

View File

@ -41,6 +41,10 @@ public class IPCDataSyncTask implements ApplicationRunner {
private String clientId; private String clientId;
@Value("${datasyn.mqtt.topicu}") @Value("${datasyn.mqtt.topicu}")
private String topicu; private String topicu;
@Value("${datasyn.mqtt.userName}")
private String userName;
@Value("${datasyn.mqtt.password}")
private String password;
@Autowired @Autowired
private InfluxDBService influxDBService; private InfluxDBService influxDBService;
@ -78,7 +82,7 @@ public class IPCDataSyncTask implements ApplicationRunner {
timer3.schedule(new TimerTask() { timer3.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
threadPoolTaskExecutor.execute(new IPCDataUploadSyncThread(mqttHost,clientId,topicu)); threadPoolTaskExecutor.execute(new IPCDataUploadSyncThread(mqttHost, clientId, topicu, userName, password));
} }
}, 1000, 1000 * 60); }, 1000, 1000 * 60);
} }