修改了amqp的使用1

This commit is contained in:
wucongxing8150 2024-05-29 14:52:10 +08:00
parent e425546627
commit 444d4907b4

View File

@ -81,7 +81,7 @@ func (r *RabbitMQ) PublishWithDelay(exchangeName, routingKey string, message int
true, // durable
false, // auto-deleted
false, // internal
false, // no-wait
false, // 阻塞处理
amqp.Table{"x-delayed-type": "direct"}, // arguments
)
if err != nil {
@ -111,13 +111,13 @@ func (r *RabbitMQ) PublishWithDelay(exchangeName, routingKey string, message int
}
// Consume 消费
func (r *RabbitMQ) Consume(queueName, exchangeName string) (<-chan amqp.Delivery, error) {
func (r *RabbitMQ) Consume(queueName string) (<-chan amqp.Delivery, error) {
q, err := r.channel.QueueDeclare(
queueName, // 队列名称
false, // 消息者名称
false, // 是否确认消费
false, // 是否持久化
false, // 是否自动删除队列
false, // 排他
false, // no-wait
false, // 阻塞处理
nil, // arguments
)
if err != nil {