0

We need to implement a WCF service for a customer based on WSDL service specification that the customer has delivered to us. We must implement the service so that it is can process only one request at a time. It is easy to configure the service so with throttling attributes, we are currently using this configuration.

<serviceThrottling maxConcurrentCalls="1" maxConcurrentInstances="1" maxConcurrentSessions="1" />

But the problem is, if the customer makes a request when the service is busy (the process might occasionally take up to two hours time to process), their request will timeout. But the IIS / WCF Service will still take the request into queue. (This is the core problem!) Because the customer's request timeouts, they are making new requests and we end up processing the same requests multiple times.

I need to either

  1. Send accept 202 status immediately when customer makes a request but still keep processing the requests one at a time. (better)
  2. Not to take the request to the queue and let the request timeout as it does now or send rejection immediately. (ok)

I could also manage if I could somehow discover run-time

  1. How many requests there are in the queue? (If I allowed processing multiple request I could discard the requests that arrive while the service is busy.)
  2. When was the request originally made? (I could stop processing a request that comes from the queue after certain time.)
Ilkka Kudjoi
  • 53
  • 1
  • 7
  • Just set apropriate time out value in config value I guess. – Michał Turczyn Sep 07 '17 at 08:19
  • Hi, you mean on the client side? Unfortunately we don't have full control over that how the customer is using the service. They said that they have something like eight minutes timeout currently but it often is not enough and for some reason they can't extend it more. If you mean server-side, can you help me out with that? – Ilkka Kudjoi Sep 07 '17 at 08:26
  • You can specify that on your side as well. When your client find service reference, it creates it configuration file based on your `wsdl`. So all the settings can be specified by you. – Michał Turczyn Sep 07 '17 at 08:27
  • Refer to: https://stackoverflow.com/questions/424358/increasing-the-timeout-value-in-a-wcf-service – Michał Turczyn Sep 07 '17 at 08:31
  • Unfortunately that did not help much. I set all the four timeout values to ten seconds and try calling the service by myself with SoapUI. The requests are not timeouting that fast, every request is added to the queue. – Ilkka Kudjoi Sep 07 '17 at 09:29

1 Answers1

0

I solved this problem by allowing more concurrent calls and maintaining own concurrent queue in my own code. Luckily that seems to work and is the best solution for the consumer as well.

In other words, the business problem was solved but not the way I was trying to in the first place.

Ilkka Kudjoi
  • 53
  • 1
  • 7