Question

I'm building a WCF service to handle all QuickBooks SDK functionality for two companies. Since the QuickBooks SDK needs to open/close the actual QuickBooks application to process a request, only one can be handled at a time or QuickBooks goes into a really bad state. I'm looking for the best way to allow end users to make a QuickBooks data request, and have my WCF application hold that request until the previous request is completed.

If nothing is currently being processed, then the request will go through immediately.

Does anyone know of the best method to handle that type of functionality? Anything third party/built-in .NET libraries?

Thanks!

Was it helpful?

Solution

Use WCF Throttling. Its configurable and will solve your problem without code changes.

See my answer for WCF ConcurrencyMode Single and InstanceContextMode PerCall.

OTHER TIPS

One way to do this is to Place a Queue between the user and the Quickbooks Application:

  • The request from the user is placed i a Queue or Data table.
  • A background process reads the one item at a time out of the Queue, sends it to Quickbooks and Places the result in a result table.
  • The Client applictaion reads the result from the result table.

This requires some work, but the user will allways be able to submit requests and only one will be processed at a time.

The solution given by ErnieL will also work if you use Concurrency mode Single, but in Heavy load scenarios the users will get timeouts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top