| | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ard.utils.DateUtils; |
| | | import com.ard.utils.mqtt.MqttConsumer; |
| | | import com.ard.utils.tcp.NettyTcpClient; |
| | | import com.ard.utils.udp.NettyUdpServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | public class TubeAlarmService { |
| | | @Resource |
| | | NettyUdpServer nettyUdpServer; |
| | | @Resource |
| | | NettyTcpClient nettyTcpClient; |
| | | @Value("${spring.netty.port}") |
| | | private Integer udpPort; |
| | | @Value("${spring.netty.enabled}") |
| | |
| | | } |
| | | nettyUdpServer.init(udpPort); |
| | | log.info("UDP服务已经启动"); |
| | | nettyTcpClient.init("112.98.126.2",1200); |
| | | log.info("TCP客户端已连接"); |
| | | } |
| | | |
| | | @Async("alarm") |