| | |
| | | if (!Cools.isEmpty(protocol.getAgvNo())) { |
| | | AgvPackage agvPackage = ProtocolUtils.installDownProtocol(protocol); |
| | | publisher.publish(agvPackage); |
| | | // 写入队列 |
| | | log.info("<UNK> >>> {}", JSON.toJSONString(agvPackage)); |
| | | rabbitTemplate.convertAndSend(RabbitmqConstant.TOPIC_EXCHANGE, RabbitmqConstant.ROUTING_KEY_DOWN.replaceFirst(RabbitmqConstant.SPILT_REGEX, protocol.getAgvNo()).replaceFirst(RabbitmqConstant.SPILT_REGEX, agvPackage.getHeader().getProtocolType().name()),new DeviceMessage(agvPackage.getSourceHexStr())); |
| | | if (rabbitTemplate.isRunning()) { |
| | | // 写入队列 |
| | | rabbitTemplate.convertAndSend(RabbitmqConstant.TOPIC_EXCHANGE, RabbitmqConstant.ROUTING_KEY_DOWN.replaceFirst(RabbitmqConstant.SPILT_REGEX, protocol.getAgvNo()).replaceFirst(RabbitmqConstant.SPILT_REGEX, agvPackage.getHeader().getProtocolType().name()),new DeviceMessage(agvPackage.getSourceHexStr())); |
| | | } else { |
| | | log.warn("RabbitTemplate is not running, message not sent"); |
| | | } |
| | | |
| | | } |
| | | } |