1、两个相同的mqtt客户端导致连接失败
This commit is contained in:
parent
444e7eb23c
commit
0aca5d7041
@ -33,10 +33,9 @@ public class GZYMQTTForwarder2 extends Forwarder {
|
||||
@Value("${mqtt.server.topic}")
|
||||
private String topic;
|
||||
|
||||
|
||||
MQTTClient mqttClient;
|
||||
|
||||
@PostConstruct
|
||||
//@PostConstruct
|
||||
void registerMe() throws MqttException {
|
||||
init(FORWARDER_NAME, "MQTT "+brokerUrl,2,FWD_DEVICE_ALIAS_NAME,10);
|
||||
mqttClient = new MQTTClient(brokerUrl, username, password,clientid);
|
||||
@ -46,7 +45,7 @@ public class GZYMQTTForwarder2 extends Forwarder {
|
||||
/**
|
||||
* 每半小时转发GNSS解算结果
|
||||
*/
|
||||
@Scheduled(cron = "0 0/10 * * * ?") // 每10分钟执行一次
|
||||
//@Scheduled(cron = "0 0/10 * * * ?") // 每10分钟执行一次
|
||||
private void forwardGnss() {
|
||||
logger.info("gzy mqtt forwardGnss");
|
||||
forwardCurrentGnss();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user