rabbitMQ如何实现单消费者多队列模型 [英] How to implement single-consumer-multi-queue model for rabbitMQ

查看:26
本文介绍了rabbitMQ如何实现单消费者多队列模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现这张图片与我的商业模式非常相似.我需要将消息拆分到某个队列.对于一些繁重的工作.我可以为他们添加更多的工作线程.但对于一些没有太多繁重的工作.我能让单个消费者订阅他们的消息.但是如何在rabbitMQ中做到这一点.通过他们的文件.我刚刚发现了单队列多消费者模型.

I have found this image is very similar to my bussiness model. I need to split message to some queue. for some heavy work. I can add more worker thread for them. But for some no much heavy work. I can let single consumer to subscribe their message. But how to do that in rabbitMQ. Through their document. I just found that single-queue-multi-consumer model.

推荐答案

  1. 您可以将多个工作人员添加到队列中
  2. 可以有多个队列绑定到一个交换.

在 RabbitMQ 中,生产者总是将消息发送到交换器.所以,在你的情况下,我希望只有一次交换就足够了.如果你想在消费者端进行负载均衡,你有上面说的两个选项.

In RabbitMQ, the producer always sends the message to an exchange. So, in your case, I hope only one exchange is enough. If you want to load balance at the consumer side, you have the above said two options.

你也可以阅读我的文章:https://techietweak.wordpress.com/2015/08/14/rabbitmq-a-cloud-based-message-oriented-middleware/

You can also read my article: https://techietweak.wordpress.com/2015/08/14/rabbitmq-a-cloud-based-message-oriented-middleware/

这篇关于rabbitMQ如何实现单消费者多队列模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆