Error in proxy while execution servicecallout policy.

plvndinesh
Participant II

1.While executing serviceCallout policy (or is it a JavaScript policy?)i am facing an error when the response from backend is getting more time(Exceeds 2000ms).

2.I am performing Pagination in java script policy while filtering the data.

if it takes more than 2000ms it throws time out error.

How to solve this two issues.

0 3 201
3 REPLIES 3

Hi

some feedback: you said you're facing an error, but you didn't describe the error symptoms. You said "I am facing error". What do you SEE? What observations can you make beyond "it doesn't work" ? If you can be specific and detailed, someone here be able to help.

Regarding the JS timeout - you asked that question separately, I think. There's a timelimit that applies to JS policies. Check the doc for info on that. https://docs.apigee.com/api-platform/reference/policies/javascript-policy#JavaScript

A ServiceCallout also has a timeout that you can configure. I'm not sure if that's affecting you because you didn't provide any details on how you're configuring the policy.

<Javascriptname="Javascript-1"enabled="true"continueOnError="false"async="false"timeLimit="200">

1.What was maximum time I can mention in timeLimit="xxxxx" in javaScript policy.

2.Ex:timeLimit="120000"(=2 minutes) if execution of javascript takes 1min.45 sec it will not create any error right, if javascript execution exceeds more than 2min it will throw javaScript time out error.

Guide me some best practices while using JavaScript policy in timing point of view.

ok, that's not a ServiceCallout policy. That's a JavaScript policy.

For paid organizations, There is no defined or documented limit on the maximum run time of a JS policy. According to the documentation page I cited, For free trial accounts, execution time for a JS policy is limited to 200 ms.

There may be a separate timeout occurring, in the HTTP Client. If you're using the JS policy to invoke the httpClient, which sends out a request... that request is also subject to a distinct timeout. I don't see that documented, but I think the default is 60 seconds.

Guide me some best practices while using JavaScript policy in timing point of view.

Just apply the timeouts you think are appropriate for your service.