简体   繁体   English

Rabbit MQ排队选项

[英]Rabbit MQ Queing options

 I have a scenario where i need to get three different type of messages. They all contains same information. Lets take for e.g

I have 3 diffrent dealers of car Ford,Honda, Nissan. 我有3个福特,本田,日产汽车的不同经销商。 They all send me message about car and its specs. 他们都向我发送了有关汽车及其规格的信息。

Would you create three queses ABCCarCompany.E.Direct.Honda ABCCarCompany.E.Direct.Nissan ABCCarCompany.E.Direct.Ford OR just one ABCCarCompany.E.Direct.Cars and have them send the car manufacturer as parameter.. What are pros of creating 3 queses vs 1 .. 您将创建三个问题ABCCarCompany.E.Direct.Honda ABCCarCompany.E.Direct.Nissan ABCCarCompany.E.Direct.Ford还是仅创建一个ABCCarCompany.E.Direct.Cars并将它们发送给汽车制造商作为参数。创建3个问题与1个问题的比较

I recommend that you send all data into a single exchange, call it CarEx. 我建议您将所有数据发送到单个交易所中,称为CarEx。 1 vs 3 queues depends on how you want to use the data. 1对3队列取决于您要如何使用数据。 If you need to do the exact same thing with each car that comes in (like put it in a database) then you only need one queue. 如果您需要对每辆进来的汽车做完全相同的事情(例如将其放入数据库中),那么您只需要一个队列。 If you need to do something different for each car (like put into a database for Ford but send an alert for Nissan) then you would want 3 different queues. 如果您需要为每辆车做一些不同的事情(例如放入福特的数据库中,但发送有关日产的警报),那么您将需要3个不同的队列。

If you have 3 different queues you can route the messages into them based on the routing key. 如果您有3个不同的队列,则可以根据路由密钥将消息路由到其中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM