开发者

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.

My aim is to have a windows service, generate tasks and put them into a queue, on the other end, i need some consume开发者_StackOverflow中文版rs, whenever who is free, pick up a tasks from the queue, and do the job specify in the message.

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. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜