[agent][init]- agent启动流程bug

This commit is contained in:
zeaslity
2023-02-25 17:05:07 +08:00
parent 511cfd97f6
commit ed5a242838

View File

@@ -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