mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
更新
This commit is contained in:
24
springboot/fastbee-gateway/gateway-boot/pom.xml
Normal file
24
springboot/fastbee-gateway/gateway-boot/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>fastbee-gateway</artifactId>
|
||||
<groupId>com.fastbee</groupId>
|
||||
<version>3.8.5</version>
|
||||
</parent>
|
||||
<artifactId>gateway-boot</artifactId>
|
||||
|
||||
<description>网关模块</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fastbee</groupId>
|
||||
<artifactId>fastbee-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.fastbee.gateway.boot.start;
|
||||
|
||||
import com.fastbee.mq.mqttClient.PubMqttClient;
|
||||
import com.fastbee.mq.redischannel.listen.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 启动类
|
||||
*
|
||||
* @author bill
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@Order(2)
|
||||
public class StartBoot implements ApplicationRunner {
|
||||
|
||||
|
||||
@Autowired
|
||||
private PubMqttClient mqttClient;
|
||||
@Resource
|
||||
private DeviceOtherListen otherListen;
|
||||
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
try {
|
||||
otherListen.listen();
|
||||
/*启动内部客户端,用来下发客户端服务*/
|
||||
mqttClient.initialize();
|
||||
log.info("=>设备监听队列启动成功");
|
||||
} catch (Exception e) {
|
||||
log.error("=>客户端启动失败:{}", e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user