开发者

continuous processing

I'm looking for suggestions on how to best have a continuously running processing engine that runs to process a job queue.

Basically, external clients can add jobs to a queue (via .net or WCF calls). This needs to return quickly and will be called often, so it just receives the request and adds it to the queue.

The processing engine should be a single process that runs continuously and processes the queue (without being directly called) in order based on a 开发者_开发问答bunch of biz logic.

How can we best create this continuously running process?

  • Is it possible to do this stably in asp.net?
  • Would it be better to do this as a WCF hosted by Windows Service?
  • Other suggestions or methods to accomplish this?

Thanks for reading this and I appreciate your help and suggestions

Note:

I've been using MSMQ to pass the data. Is there anyway that you can automatically invoke a process to run on receipt of the message (or if there are messages in the MSMQ queue (I don't know much about MSMQ)).

For example, client A sends MSMQ message to client B via queue Q. Q was empty. Client B now has a message in the Q.

How do I invoke a method to process this? How to host the client that receives the message?


A windows service that will process the queue is the classic way to do this. It has many benefits, including the ability to start up on reboots, good scriptability for management (WMI), so it will also be the preferred choice by sysadmins.

Keep it separate from your WCF service - you should use that for putting jobs on the queue.


Is it possible to do this stably in asp.net?

Yes, it is possible. However, if you're passing a lot of data, the option below may be better, as you have more options for communication channels.

Would it be better to do this as a WCF hosted by Windows Service?

This is likely the best option. This would give you the option of using higher performance communication channels (to help the throughput of your "many requests"), good control, etc. It's also much lower overhead, since you don't need to setup IIS for it to run if you self-host.


I think MSMQ is what you are exactly looking for. One of its important tasks is ensuring reliable delivery. It is easy to use it in .Net and the best thing you will love about it is that there is a WCF binding for it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜