views:

195

answers:

1

Hello,

I want to write a WCF service that can't run more than X times per hour. I want the service to suspended messages to a queue if the service was called more than x time in the last 60 minutes.

Any ideas how can one limit the service? I am willing to write custom components in the WCF stack.

+1  A: 

Using a database, xml file, or some other datastore, record the date and time of every call to the service, and if it did any work. Every time the service is called:

1) Check the count of the records in your datastore that did work within the last 60 minutes. 2) If less than X, do work, record that you did work, and when. 3) If more than x move the request to the queue, record the request.

You'll need something checking your queue of work to be done too (windows service?), and to determine if the work done in the queue counts against your X times per hour or not.

This is all very high level as we know nothing specific about your project, HTH.

JasonS