[英]Offline Processing of POST Request
I am developing an Application where I am submitting POST Requests to a .NET Web Service. 我正在开发一个向NET Web服务提交POST请求的应用程序。
Current implementation is to process the request instantly and give response. 当前的实现是立即处理请求并给出响应。 In actual deployment, there will be huge amount of data that needs to be processed and thus the request must be processed offline. 在实际部署中,将需要处理大量数据,因此必须脱机处理请求。
What are the strategies that can have the task accomplished 可以完成任务的策略是什么
Should I implement a Windows Service, or a scheduled task that invokes an application to perform the desired task. 我应该实现Windows服务还是调用应用程序执行所需任务的计划任务。
This might be a good case for MSMQ. 对于MSMQ,这可能是个好例子。 Your webservice can fill the queue with incoming data, and another process can read those messages and perform the necessary processing. 您的Web服务可以用传入的数据填充队列,另一个进程可以读取这些消息并执行必要的处理。
Here's a good overview of MSMQ: 以下是MSMQ的概述:
http://www.primaryobjects.com/CMS/Article77.aspx http://www.primaryobjects.com/CMS/Article77.aspx
If you have so much data it cannot be processed in real-time, I would probably setup the service to do the following: 如果您有太多数据无法实时处理,我可能会将该服务设置为执行以下操作:
ProcessRecordViaPost ProcessRecordViaPost
ReadRecordViaGet ReadRecordViaGet
I would also have a windows service that continually grabs the oldest item from the Queue, and processes it and moves on to the next oldest. 我还将拥有一个Windows服务,该服务不断从Queue中获取最旧的项目,并对其进行处理并移至下一个最旧的项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.