[agent][ init]- fix bug

This commit is contained in:
zeaslity
2023-02-28 11:32:36 +08:00
parent b31480ec8c
commit c51fdaad13

View File

@@ -48,20 +48,22 @@ public class GenOctopusRabbitMQConnection {
// reboot judgement of existing exchange // reboot judgement of existing exchange
QueueInformation queueInfo = rabbitAdmin.getQueueInfo(agentTopicName); QueueInformation queueInfo = rabbitAdmin.getQueueInfo(agentTopicName);
if (ObjectUtils.isEmpty(queueInfo)) {
if (ObjectUtils.isNotEmpty(queueInfo)) { log.debug("开始为Agent创建相形的消息队列");
log.info(
"Octopus Agent Specific Topic Queue Already Existed ! == {}",
agentTopicName
);
return;
} }
Queue queue = new Queue(agentTopicName, true, false, false); Queue queue = new Queue(
agentTopicName,
true,
false,
false
);
Binding binding = new Binding( Binding binding = new Binding(
agentTopicName, agentTopicName,
Binding.DestinationType.QUEUE, Binding.DestinationType.QUEUE,
octopusMessage.getContent().toString(), octopusMessage
.getContent()
.toString(),
agentTopicName + "*", agentTopicName + "*",
null null
); );
@@ -77,8 +79,7 @@ public class GenOctopusRabbitMQConnection {
listenerContainer.setMessageListener(this::AgentListenToSpecificTopicOctopusMessage); listenerContainer.setMessageListener(this::AgentListenToSpecificTopicOctopusMessage);
listenerContainer.start(); listenerContainer.start();
log.info("每个Agent特定的Octopus Topic Queue创建成功!");
log.info("Specific Octopus Topic Queue Generate Successfully !");
messageListenerContainerList.add(listenerContainer); messageListenerContainerList.add(listenerContainer);
} }