From ed5a24283854b40703785462aa9dd9d405040dfd Mon Sep 17 00:00:00 2001 From: zeaslity Date: Sat, 25 Feb 2023 17:05:07 +0800 Subject: [PATCH] =?UTF-8?q?[agent][init]-=20agent=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=B5=81=E7=A8=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent/initialization/bootup/OctopusAgentInitService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/src/main/java/io/wdd/agent/initialization/bootup/OctopusAgentInitService.java b/agent/src/main/java/io/wdd/agent/initialization/bootup/OctopusAgentInitService.java index e7d90c3..11d7e7b 100644 --- a/agent/src/main/java/io/wdd/agent/initialization/bootup/OctopusAgentInitService.java +++ b/agent/src/main/java/io/wdd/agent/initialization/bootup/OctopusAgentInitService.java @@ -9,6 +9,7 @@ import io.wdd.common.beans.rabbitmq.OctopusMessage; import io.wdd.common.handler.MyRuntimeException; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import org.checkerframework.checker.units.qual.K; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.*; import org.springframework.amqp.support.AmqpHeaders; @@ -79,7 +80,7 @@ public class OctopusAgentInitService { // consider the multi-agents register situation // judge the machineID begin String[] split = octopusMessage.getUuid().split("-"); - if (!agentServerInfo.getMachineId().startsWith(split[split.length - 1])) { + if (!agentServerInfo.getMachineId().startsWith(split[3])) { String s = "INIT Message not for this agent !"; log.error(s); throw new MyRuntimeException(s); @@ -90,7 +91,6 @@ public class OctopusAgentInitService { throw new MyRuntimeException(" Handle Octopus Message Error !"); } - } catch (Exception e) { // reject the message