I'm developing a rather large website with which included a customer base and billing plans. The monthly billing should happen automatically (however, an employee should, manually, click a button to initiate the process every month due to business rules) and the number of customers are between 3000 - 5000. On every single invoice, the price lines should be calculated based on quite a lot of parameters and even external data from a webservice.
The above will definitely be a (very) long running task and since the application is an ASP.NET MVC website running on IIS, I don't want the process to run in it's own thread on IIS. My concerns are that if anything happens to IIS/the webserver, the billing calculation process stops aswell, which would be critical, to say the least.
Therefore I'm looking for alternatives and have read about creating a Windows Service for tasks like this. Is this the way to go? Or is there other, maybe more "modern" ways of running long processes? The process has to able to be started from the ASP.NET MVC application though.
Any help/hint is greatly appreciated! :-)
Looks like a good solution for SignalR: http://www.asp.net/signalr
Normally, this would be the ideal case for a SQL stored proc / agent job, but not if you need to call an external webservices for each bill to gather the data needed.
As long as you have a 'header' record for the bill run, you can easily store which record you're currently on and whether the run has completed or not. This will always be a consideration whether you run as a windows service or a thread in IIS - someone could turn off the machine at any point.
SignalR will allow you to