Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Continue the proxy preflow when JS policy timeout occurs

Hi Team,

I have added the continueOnError="true" and timeLimit="1000" in JS policy.

I am calling another end point from above JS policy AuthHandler.js code. If another end point taking more then 1000ms then execution got abort and get the script execution failed and next flows did not execute. 

chetannarula27_0-1730825651626.pngchetannarula27_1-1730825822459.png

 

But i want to execute the next flows. so i can do the retry to execute again the JS policy or I can implement the retry when timeout happen once.

Tried to implement the retry using fault rule based on script execution failed  and call again the JS policies and flows but target end point not being executed.
How we can achieve the retry when JS policy time out.

Thanks,

Chetan

0 3 399
3 REPLIES 3

Hey, thank you for sharing your question! Will keep an eye on this conversation to ensure you receive a helpful reply.

We’d also love for you to join us at our upcoming no-cost virtual event on November 14, focused on Spec-Driven Development (SDD) and Continuous Integration/Continuous Delivery (CI/CD) for Apigee—check it out and register here😊

Hi @chetannarula27! Looking at your output I see that the process was aborted. It is not clear what would cause this state to occur at this time since we don't see what the JavaScript is doing nor whether the aborting of the process is even related to the JavaScript. Nevertheless, I would like to take note that setting the attribute continueOnError is just one step in making sure that faults and exceptions are properly managed. Fault handling beyond what is available on the policy as an attribute is covered with fault handling rules and error flows that are available. It may be necessary to make use of the Fault rules so that you can manage faults properly. 

Also, let's bear in mind that the JavaScript being executed can in fact exceed time limits if not constrained by reading time limit variables set in the proxy. If the JavaScript execution does in fact exceed time limits the best you will do is to properly manage the processes invoked by the Javascript and by making use of fault rules. 

Hi @chetannarula27, thank you for engaging with the Apigee forum, and thanks to @friasc for the response.

If this resolves your issue, consider marking their reply as the accepted solution to assist others with similar questions.

Don’t forget to check out our latest articles and resources—we’re regularly publishing new content. Thanks for being part of the community!