You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package com.xydl.util;
|
|
|
|
|
|
|
|
import com.xydl.service.impl.MqttServiceImpl;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
public class Subscribe {
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(MqttServiceImpl.class);
|
|
|
|
|
|
|
|
private static Subscribe single = new Subscribe();
|
|
|
|
|
|
|
|
private Subscribe(){
|
|
|
|
logger.info("开始订阅===subScribe执行一次==={}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
new MqttUtil().subScribeMQTT();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Subscribe getInstance(){
|
|
|
|
return single;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|