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

看代码的疑惑? #1

Open
zt3862266 opened this issue Oct 23, 2017 · 1 comment
Open

看代码的疑惑? #1

zt3862266 opened this issue Oct 23, 2017 · 1 comment

Comments

@zt3862266
Copy link

在 setupChannel函数中
err = channel.Qos(1, 0, false)
在这里设置的 prefechtCount为1
那么当单条消息未ACK的时候,是无法consumer下一条消息的
因此 receiveMessage 中,获取消息的速度其实还是收到了消费的影响,未能实现真正的高并发消费

@wenfei3
Copy link

wenfei3 commented Feb 19, 2019

在 setupChannel函数中
err = channel.Qos(1, 0, false)
在这里设置的 prefechtCount为1
那么当单条消息未ACK的时候,是无法consumer下一条消息的
因此 receiveMessage 中,获取消息的速度其实还是收到了消费的影响,未能实现真正的高并发消费

为了保证消息投递的可靠性,必须要保证每条消息都ack。也可以这样来想,假如当前消息未ack,则说明consumer端不稳定,此时让消息堆积在mq中而不是直接push出去是更合理的做法。

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