Shreyas arya

Generation

generate functionWed, 08 Feb 2023

When requests to Step Function fail, Workflow Service performs exponential backoff retries to notify Step Function service.

public class ExponentialBackoff { private static final int MAX_RETRIES = 5; private static final long INITIAL_DELAY = 500; private static final long MAX_DELAY = 15000; public static void main(String[] args) { int currentRetries = 0; long delay = INITIAL_DELAY; while (currentRetries < MAX_RETRIES) { System.out.println("currentRetries: " + currentRetries + " ; delay: " + delay); currentRetries++; delay *= 2; if (delay > MAX_DELAY) { delay = MAX_DELAY; } } } }

Questions about programming?Chat with your personal AI assistant