How to retry REST messages when there is an error?

stevewilson
Kilo Contributor

We are currently integrating with a customer's ticketing system and are trying to figure out how to automatically resend a REST message if there is an error.

For example if the server is down, is there a way to queue up the REST messages and retry them at another time or at a set interval (retry every 5 minutes until successful).

I know this is possible with SOAP but I am not seeing anything for REST.

1 ACCEPTED SOLUTION

Hi Steve,



Here is a screenshot of the actual policy that I made. The key would be to set the agent to RESTClient and build an appropriate condition for your need.


find_real_file.png



Please mark responses helpful and/or answered if you find them so. We work for points here


View solution in original post

8 REPLIES 8

Robert Beeman
Kilo Sage

Hello Steve,



You can enable the ECC Queue Retry Policy plugin to do this (ECC Queue Retry Policy - ServiceNow Wiki). You'll have to send the message async so that it utilizes the ECC queue. I haven't done it with REST before so I tried it out in my personal developer instance with a very simple condition of state=error. It successfully retried to send until the maximum I specified in the policy.



find_real_file.png


Thank you. I will look into this and see what I can do.


Hi Steve,



Here is a screenshot of the actual policy that I made. The key would be to set the agent to RESTClient and build an appropriate condition for your need.


find_real_file.png



Please mark responses helpful and/or answered if you find them so. We work for points here


Thanks again for the information. We have been testing this for the past few weeks and everything is working as expected. We can successfully retry REST messages with the retry times we have setup.