0
votes

I have an API that is only accessible via API management. When the API is called 100+ times concurrently the Api starts failing. I came across this document that explains what needs to be done.

https://docs.microsoft.com/en-us/azure/api-management/api-management-advanced-policies

Ive inserted the below policy as specified in the document (At the Product level in API Management)

<policies>
  <inbound>…</inbound>
  <backend>
    <limit-concurrency key="someConstantId" max-count="3">
      <forward-request timeout="120"/>
    <limit-concurrency/>
  </backend>
  <outbound>…</outbound>
</policies>

but when trying to save, i'm getting error

One or more fields contain incorrect values:
The 'limit-concurrency' start tag on line 43 position 14 does not match the end tag of 'backend'. Line 46, position 7.

I then changed the policy to

   <policies>
      <inbound>…</inbound>
      <backend>
        <limit-concurrency key="someConstantId" max-count="3"/>
      </backend>
      <outbound>…</outbound>
    </policies>

It saved Ok but had no effect in solving my concurrency issue

What am i doing wrong?

1

1 Answers

2
votes

I think that the end tag is incorrect :

<limit-concurrency key="someConstantId" max-count="3">
      <forward-request timeout="120"/>
<limit-concurrency/>

I guess it should be :

<limit-concurrency key="someConstantId" max-count="3">
      <forward-request timeout="120"/>
</limit-concurrency>