WCF for Queue-ing processing intensive tasks
Posted on 2009-04-19
I am working with an ASP.NET site that must interact with a vendor's XML-based API using HTTP Request / Response pairs.
There is a strong possibility that the site will perform poorly under a heavy traffic load due to the overhead involved in making 2 HTTPRequest calls for each user submission.
In order to deal with this problem, I would like to handle the requests asynchronously by queuing the requests and just displaying a message that says "Your request has been received. You will receive an email when your account has been created in the database. Thanks...".
I am struggling with the stateless-model of programming. In a console application, I would create a separate Thread that processes Commands when the Count of the Queue is > 0. Initial experiments using the Application object (and serialization) have failed.
After a lot of reading, I think that I may need to do this with WCF. Can someone confirm that this situation is a good match for WCF and give me some direction as to which options I should select in order to do this in the simplest manner possible?
My service should only be callable by one aspx page - how does this affect the options I should select in creating the service?
Can a WCF application maintain the state of the queue? Does this mean that I need to run it as a windows service? Or can I still run it under IIS?
Some of my reading has made me wonder if I should use WCF with MSMQ. Is this necessary? I just need a basic command queue and I definitely don't want the client to have to install MSMQ to be able to use the app.
Would there be any advantage to creating this as a web service instead of a WCF app?
This is my first .NET application. I am reading Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition and the O'Reily WCF book. Any other links / resources would be appreciated.