From ad46ec101f19c65d1c7ecda38608ea9fac7c9ef1 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期六, 28 二月 2026 10:11:07 +0800
Subject: [PATCH] 1
---
zy-acs-gateway/src/main/java/com/zy/acs/gateway/listen/MessageListener.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/zy-acs-gateway/src/main/java/com/zy/acs/gateway/listen/MessageListener.java b/zy-acs-gateway/src/main/java/com/zy/acs/gateway/listen/MessageListener.java
index 99904ef..56c1489 100644
--- a/zy-acs-gateway/src/main/java/com/zy/acs/gateway/listen/MessageListener.java
+++ b/zy-acs-gateway/src/main/java/com/zy/acs/gateway/listen/MessageListener.java
@@ -6,10 +6,14 @@
import com.zy.acs.common.utils.RedisSupport;
import com.zy.acs.framework.common.Cools;
import com.zy.acs.gateway.config.SystemProperties;
+import com.zy.acs.gateway.constant.ProtocolType;
+import com.zy.acs.gateway.constant.RabbitmqConstant;
+import com.zy.acs.gateway.domain.AgvPackage;
import com.zy.acs.gateway.job.DispatcherPublisher;
import com.zy.acs.gateway.utils.ProtocolUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -33,6 +37,10 @@
@Autowired
private SystemProperties systemProperties;
+ @Autowired
+ private RabbitTemplate rabbitTemplate;
+
+
@PostConstruct
private void start(){
thread = new Thread(() -> {
@@ -43,7 +51,11 @@
log.info("鐩戝惉鍣� >>> {}", JSON.toJSONString(protocol));
}
if (!Cools.isEmpty(protocol.getAgvNo())) {
- publisher.publish(ProtocolUtils.installDownProtocol(protocol));
+ AgvPackage agvPackage = ProtocolUtils.installDownProtocol(protocol);
+ publisher.publish(agvPackage);
+ // 鍐欏叆闃熷垪
+ rabbitTemplate.convertAndSend(RabbitmqConstant.TOPIC_EXCHANGE, RabbitmqConstant.ROUTING_KEY_DOWN.replaceFirst(RabbitmqConstant.SPILT_REGEX, protocol.getAgvNo()).replaceFirst(RabbitmqConstant.SPILT_REGEX, agvPackage.getHeader().getProtocolType().name()), agvPackage.getBody().getMessageBody());
+
}
}
// 闂撮殧
--
Gitblit v1.9.1