Windows services or scheduled tasks, which one to use? RRS feed

  • Question

  • Hi all- I know there are number of forums which already answered this question. But my case is little different. Let me explain the problem.

    we have a windows service which currently is working fine. It checks the DB for requests in a particular status. upon finding one, it checks the action type for that request and process according to the action type. This processing includes taking  text files and convert them to excel files using oledb, send the email to a set of users with the report as attachment. The created excel file sometimes will be  50-60 MB and it will take 4-5 minutes. All these are inside an infinite loop in the service so that we can check the DB continuously. Current process works fine. no issues. 

    We are planning to add couple of more action types and each action type needs to be processed in parallel. These action type may or may not have report creation , email sending or some other functionality. We have ended up with 2 methods to solve the above problem.

    Method 1:- Implement the new action types in the existing windows service and use the new "task parallel library" in the dot net frame work to parallel process all the action types.

    method 2:- create a console application which takes action types as parameters. Create scheduled tasks in windows scheduler for each action types and pass the action type as parameter in each scheduled task. Schedule each tasks to run every 1 minute. so we will have 3-4 scheduled tasks, each running every 1 minute parallel.

    Please help me to choose the correct method. I am not sure if i am posting this in the current forum. 



    Friday, October 18, 2013 3:19 AM