| | |
| | | package com.sandu.ximon.admin.manager.iot.amqp; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | |
| | | * @date 2021/12/2 17:45 |
| | | */ |
| | | @Component |
| | | @AllArgsConstructor |
| | | //@AllArgsConstructor |
| | | public class InitAmqpListener { |
| | | |
| | | private final MqttMainBoardConfig mqttMainBoardConfig; |
| | | @Autowired |
| | | private MqttMainBoardConfig mqttMainBoardConfig; |
| | | @Value("${listenter.isOpen}") |
| | | private boolean isOpen; |
| | | |
| | | /* @PostConstruct |
| | | @PostConstruct |
| | | public void initListener() throws Exception { |
| | | new AmqpClient( |
| | | mqttMainBoardConfig |
| | | ).execute(); |
| | | }*/ |
| | | if (isOpen) { |
| | | new AmqpClient( |
| | | mqttMainBoardConfig |
| | | ).execute(); |
| | | } |
| | | } |
| | | } |