parent
615a12af00
commit
32e3afb2a7
@ -1,30 +0,0 @@
|
||||
package cc.yunxi.config;
|
||||
|
||||
import cc.yunxi.config.props.MqttProperties;
|
||||
import cc.yunxi.utils.CustomerMqttClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.paho.mqttv5.common.MqttException;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
@Slf4j
|
||||
//@Configuration
|
||||
//@EnableConfigurationProperties(MqttProperties.class)
|
||||
public class MqttConfig {
|
||||
|
||||
// @Resource
|
||||
private MqttProperties properties;
|
||||
|
||||
// @Bean
|
||||
public CustomerMqttClient customerMqttClient() throws MqttException {
|
||||
CustomerMqttClient client = new CustomerMqttClient();
|
||||
// client.setMqttProperties(properties);
|
||||
client.connect();
|
||||
log.info("===========> MQTT连接成功 <===========");
|
||||
return client;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue