简体   繁体   English

我如何使用NServiceBus来做竞争消费者

[英]How can i use NServiceBus to do Competing Consumers

I went thought the document of nservicebus http://docs.particular.net/ , but still confuse how can i do what i want to do. 我想到了nservicebus http://docs.particular.net/的文件,但仍然混淆我怎么能做我想做的事情。

My aim is to have a windows service, generate tasks and put them into a queue, on the other end, i need some consumers, whenever who is free, pick up a tasks from the queue, and do the job specify in the message. 我的目标是拥有一个Windows服务,生成任务并将它们放入队列,另一方面,我需要一些消费者,无论谁有空,从队列中获取任务,并在消息中指定作业。

can anyone give me some hint, how can i continue?? 任何人都可以给我一些提示,我怎么能继续?

Thanks 谢谢

The distributor will do exactly what you are after. 经销商将完全按照您的要求行事。 Basically the distributor will control n number of nodes which use a round robin style work allocation. 基本上,分发者将控制使用循环式工作分配的n个节点。 The nodes register with the distributor by passing a "I'm ready for work" message to it. 节点通过向我传递“我准备工作”消息向分发者注册。 The distributor then puts these messages in a queue. 然后,分发者将这些消息放入队列中。 When the distributor receives the real message, it will pop the first "I'm ready" message off the queue and forward the message onto the appropriate node. 当分发者收到真实消息时,它将从队列中弹出第一个“我准备好”消息并将消息转发到适当的节点上。 When the node then finishes processing the message, he'll send a new "I'm ready" message to the distributor which will end up on the bottom of the queue. 当节点完成处理消息后,他将向分发者发送新的“我准备好”消息,该消息将最终位于队列的底部。

So basically, it'll do exactly what you want. 所以基本上,它会完全按照你的意愿行事。

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

相关问题 我可以告诉AutoMapper如何在竞争地图之间进行选择吗? - Can I tell AutoMapper how to pick between competing maps? RabbitMQ - 主题交流和竞争消费者 - RabbitMQ - Topic Exchanges and Competing Consumers 当生产者也是消费者时,如何在生产者/消费者模式中使用阻塞收集 - 我该如何结束? - How do I use a blockingcollection in the Producer/Consumer pattern when the producers are also the consumers - How do I end? 如何使用NServiceBus部分加载处理程序? - How can I partially load handlers with NServiceBus? 如何为NServicebus的NHibernate Saga Persister使用Version属性? - How do I use a Version property for NServicebus's NHibernate Saga Persister? NServiceBus 4.4.2如何在配置中设置TimeoutPersisterReceiver时间跨度 - NServiceBus 4.4.2 how do i set the TimeoutPersisterReceiver timespan in config 如何配置NServiceBus来扫描程序集以查找IMessage? - How do I configure NServiceBus to scan an assembly for IMessage? 如何在NServiceBus中正确合并多个消息? - How do I correctly pool multiple message in NServiceBus? 如何测试我的ConfigureHowToFindSaga是否在NServiceBus中正常工作? - How do I test that my ConfigureHowToFindSaga is working in NServiceBus? 我如何单元测试NServiceBus.Configure.WithWeb()? - How do I Unit Test NServiceBus.Configure.WithWeb()?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM