I’m currently trying to interface our new intranet (ASP-MVC) with the web front end of our pager system. The pager system’s front end is about 10 years old, poor interface and no documentation. To do this I have the form on the intranet post to the server, our server then sends an HTTP POST to the pager server that mimics what its own form sends.
While testing this for overloading (we sent about 10 messages almost concurrently) the pager server crashed, as the system is a black box and the only difference we noticed was the concurrent POSTs the least we can do is try to prevent this happening.
I want to have all messages go into a queue that sends at most once every 5-10 seconds but I’m not sure how to implement this, does anyone have any suggestions or links to some basic tutorials to get me started please?
Update
I didn’t specify this earlier but the process should be synchronous from the point of view of the browser, ie webserver gets the http POST request from the browser, message is put into the queue, message is sent from the queue, webserver sends http response to the browser. This is not a high volume service and I expect simultaneous requests to be rare so response will be near instantaneous, it is more of a throttle to prevent potential issues with concurrent requests.
Assuming, you don’t want to loose any request, your queue needs to be persistent. You can roll up your own implementation and puts the data into database or you can use MessageQueue as ready-made backing store. Your intranet site will be pushing (sending) messaged into database or MSMQ. You can write windows service or a scheduled console application to read from queue (using polling) and then post the data to your pager system.
Here are few articles to start with message queue:
http://www.primaryobjects.com/CMS/Article77.aspx and
http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.aspx