[ Service ] [ Executor ] 初步重构Executor部分的代码
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -126,7 +127,7 @@ func handleInitMsgFromServer(initFromServerQueue *rabbitmq.RabbitQueue, initToSe
|
|||||||
serverName := serverInfo.ServerName
|
serverName := serverInfo.ServerName
|
||||||
|
|
||||||
// 处理OM信息
|
// 处理OM信息
|
||||||
if initOctopusMsg != nil && initOctopusMsg.Type == g.InitOmType && serverName == agentServerInfo.ServerName {
|
if initOctopusMsg != nil && strings.HasPrefix(initOctopusMsg.Type, g.InitOmType) && strings.HasPrefix(serverName, agentServerInfo.ServerName) {
|
||||||
// 是本机的注册回复信息
|
// 是本机的注册回复信息
|
||||||
log.InfoF("OctopusMessage INIT from server is this agent !")
|
log.InfoF("OctopusMessage INIT from server is this agent !")
|
||||||
|
|
||||||
@@ -144,7 +145,7 @@ func handleInitMsgFromServer(initFromServerQueue *rabbitmq.RabbitQueue, initToSe
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 不是自身的 注册回复信息 -- 拒绝 2023年6月19日 此处存在错误! 会死循环Nack 导致异常
|
// 不是自身的 注册回复信息 -- 拒绝 2023年6月19日 此处存在错误! 会死循环Nack 导致异常
|
||||||
log.Warn(fmt.Sprintf("OctopusMessage INIT from server not this agent ! => %v, ==>%s", initOctopusMsg, delivery.Body))
|
log.Warn(fmt.Sprintf("OctopusMessage INIT from server not this agent ! => %v, ", initOctopusMsg))
|
||||||
delivery.Ack(false)
|
delivery.Ack(false)
|
||||||
|
|
||||||
// 需要休眠等待不再获取相应的信息
|
// 需要休眠等待不再获取相应的信息
|
||||||
|
|||||||
@@ -52,19 +52,6 @@ public class OMessageToAgentSender {
|
|||||||
octopusMessage
|
octopusMessage
|
||||||
);
|
);
|
||||||
|
|
||||||
// 统一处理Content
|
|
||||||
if (octopusMessage.getContent() instanceof String) {
|
|
||||||
try {
|
|
||||||
|
|
||||||
String contendString = OctopusObjectMapper.writeValueAsString(octopusMessage.getContent());
|
|
||||||
|
|
||||||
octopusMessage.setContent(contendString);
|
|
||||||
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rabbitTemplate.convertAndSend(
|
rabbitTemplate.convertAndSend(
|
||||||
initRabbitMQConfig.INIT_EXCHANGE,
|
initRabbitMQConfig.INIT_EXCHANGE,
|
||||||
initRabbitMQConfig.INIT_FROM_SERVER_KEY,
|
initRabbitMQConfig.INIT_FROM_SERVER_KEY,
|
||||||
|
|||||||
Reference in New Issue
Block a user