| | |
| | | } |
| | | |
| | | public void saveLogToMq(String topic_exchange, String routingKey, DeviceMessage message) { |
| | | if (flag && rabbitTemplate.isRunning()) { |
| | | if (flag) { |
| | | // 写入队列 |
| | | rabbitTemplate.convertAndSend(topic_exchange, routingKey, message); |
| | | } else { |
| | |
| | | if (!Cools.isEmpty(protocol.getAgvNo())) { |
| | | AgvPackage agvPackage = ProtocolUtils.installDownProtocol(protocol); |
| | | publisher.publish(agvPackage); |
| | | if (flag && rabbitTemplate.isRunning()) { |
| | | if (flag) { |
| | | // 写入队列 |
| | | 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 { |
| | |
| | | password: xltys1995 |
| | | |
| | | rabbitmq: |
| | | enable: false |
| | | enable: true |
| | | host: localhost |
| | | port: 5672 |
| | | username: root |