Retrying with amqpRequest Step

If you have a service that is using the AMQP protocol and you want to build that into your formula, but there is no option to retry the step upon failure, Cloud Elements offers a solution.

The basic idea behind the httpRequest step retry step option is to do just that, retry "x" number of times until success or the max limit is reached (5 retries). You can build the same logic into your amqpRequest step. 

Follow these steps:

  1. Figure out which status codes you want to retry on. It doesn't make sense to retry on ALL non 200 response codes because sometimes the failure is an unrefreshed token or something like that and no amount of retries will fix the root cause. 
  2. After you set up the basic info for the amqpRequest select On Failure.
  3. Select the JS Script step. 
  4. In the JS Script step build out the logic that will increment a counter to retry the amqpRequest step. Keep this number relatively low (5 retries). If the number is massive you will tie up server resources, potently enraging your fellow Cloud Elements community. 
  5. Once the counter hits the max number of retries (5, see there's a common idea of ONLY 5 retries) have the JS Script step retry the whole formula. You will want to make sure you build in stop logic. This is incase the step keeps failing it does not get stuck in a infinite loop and never actually executes the flow.