0

I'm looking for a way to set explicitly a connect timeout (not a timeout for my backend service) on APIs hosted on azure APIm

anyone has already tried ?

Seb
  • 3,602
  • 8
  • 36
  • 52

2 Answers2

0

You can leverage the timeout attribute available in the forward-request policy. This is an optional attribute with default value of 300 seconds (5 minutes).

More Information: Timeout attribute refers to the time in seconds to wait for HTTP response headers to be returned by your backend service before a timeout error is raised.

Also note that the timeout value greater than 240 seconds may not be honored, this is because underlying network infrastructure can drop idle connections after this time. Minimum value for this is 0 seconds and default value is 300 seconds. Hope this helps.

NaveenBaliga
  • 449
  • 1
  • 2
  • 5
  • Hi @NaveenBaliga, thanks for your answer, Yes I can use the forward-request-policy, but it's not the timeout I'm looking for. I need the connect timeout which is different from basic timeout. Basically it says, ok if your can't reach the backend within 30 ms just stop. – Seb Apr 14 '23 at 08:31
0

You can leverage the Send-request inbound policy with the timeout property which sends request to the specified URL, waiting no longer than the set timeout value. The default timeout for this is 60 seconds. Also mention the mode attribute as new which is the default value.

NaveenBaliga
  • 449
  • 1
  • 2
  • 5