2

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!

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
someguy0005
  • 125
  • 2
  • 12

2 Answers2

3

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

See my answer for WCF ConcurrencyMode Single and InstanceContextMode PerCall.

Community
  • 1
  • 1
ErnieL
  • 5,773
  • 1
  • 23
  • 27
0

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.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • Thanks Shiraz, this is currently going to be used by 2 people (one from each company), so load isn't a problem at the moment unless we scale like crazy. As is the case with most smaller companies, the quickest to implement solution was more of a bonus, since everyone's waiting for this to fix a broken (manual) process. – someguy0005 Mar 19 '14 at 01:59
  • Is there a simple lightweight message queue framework from microsoft that isn't MSMQ? We are restricted as to what we can install on our servers. – SoftwareSavant Dec 10 '15 at 13:56
  • @DmainEvent you should as this as a seperate question – Shiraz Bhaiji Dec 10 '15 at 16:11