[agent-go] 调通Executor的代码

This commit is contained in:
zeaslity
2023-03-27 16:06:33 +08:00
parent 5accd999f8
commit 31f9267401
9 changed files with 124 additions and 54 deletions

View File

@@ -2,6 +2,7 @@ package rabbitmq
import (
"fmt"
"github.com/nacos-group/nacos-sdk-go/v2/common/logger"
"github.com/streadway/amqp"
)
@@ -24,16 +25,19 @@ func Send(conn *RabbitMQConn, connProp *ConnectProperty, message []byte) {
channel := conn.Channel
// 发送
channel.Publish(
err := channel.Publish(
connProp.ExchangeName,
connProp.TopicKey,
false,
true,
false,
amqp.Publishing{
ContentType: "text/plain",
Body: message,
},
)
if err != nil {
logger.Error(fmt.Sprintf("Failed to publish a message: %v", err))
}
}
func Read(conn *RabbitMQConn, connProp *ConnectProperty, autoAck bool) <-chan amqp.Delivery {