admin管理员组文章数量:1404619
I have 20000 devices which send the messages that I push to RabbitMQ, on the other side I have 1 or more worker services that process the message and reply to a custom response queue on RabbitMQ. I need to ensure strict message ordering in RabbitMQ while also achieving high throughput.
I've searched the web and these are the options that I came up with:
- Single queue, single consumer
Guarantees order but limits throughput since only one consumer can process messages at a time. - Single queue, single consumer with
ConcurrentMessageLimit
> 1
Risks breaking order due to concurrent processing within the consumer. - Queue per device, single consumer per queue
Could work, but would need to create a lot of queues. Get's complicated if user adds a new device or removes one. - RabbitMQ Super Streams with Single Active Consumer
This option looks promising, however in the end it really looks like option 3 with added throughput benefits. Or am I missing something? As far as I understand I still need to have 20000 streams and handle the cases when device is added or remove to do the cleanup of individual streams.
For example, if I have 3 queues as in the official example this would still mean that I have 3 active consumers but with concurrency limit = 1. Which means I can achieve high throughput by adding as many streams as necessary to suffice for my workload. Did I get it right? What if workload increases - does this mean I need to be able to add streams dynamically, is this even supported by super streams?
本文标签: How to guarantee message ordering while maintaining high throughput in RabbitMQStack Overflow
版权声明:本文标题:How to guarantee message ordering while maintaining high throughput in RabbitMQ - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744838491a2627777.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论