Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 声明消费者参数不足 #16

Closed
shuqingzai opened this issue Aug 15, 2022 · 0 comments
Closed

[BUG] 声明消费者参数不足 #16

shuqingzai opened this issue Aug 15, 2022 · 0 comments

Comments

@shuqingzai
Copy link
Contributor

shuqingzai commented Aug 15, 2022

最新修改的代码中
https://github.com/tx7do/kratos-transport/blob/5cbe362109/broker/rabbitmq/connection.go#L251
新增了 autoDel 参数,但是调用端没有使用 这里 7 个参数

func (r *rabbitConnection) Consume(queueName, routingKey string, bindArgs amqp.Table, qArgs amqp.Table, autoAck, durableQueue, autoDel bool) (*rabbitChannel, <-chan amqp.Delivery, error) {
	consumerChannel, err := newRabbitChannel(r.Connection, r.qos)
	if err != nil {
		return nil, nil, err
	}

	if err = consumerChannel.DeclareQueue(queueName, qArgs, durableQueue, autoDel); err != nil {
		return nil, nil, err
	}

	deliveries, err := consumerChannel.ConsumeQueue(queueName, autoAck)
	if err != nil {
		return nil, nil, err
	}

	if err = consumerChannel.BindQueue(queueName, routingKey, r.exchange.Name, bindArgs); err != nil {
		return nil, nil, err
	}

	return consumerChannel, deliveries, nil
}

调用端
参数不足,直接报错,只传递 6 个参数
https://github.com/tx7do/kratos-transport/blob/5cbe362109/broker/rabbitmq/subscriber.go#L75

		ch, sub, err := s.r.conn.Consume(
			s.opts.Queue,
			s.topic,
			s.headers,
			s.queueArgs,
			s.opts.AutoAck,
			s.durableQueue,
		)
@tx7do tx7do closed this as completed Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants