Shreyas arya

Generation

generate functionThu, 09 Feb 2023

When requests to Step Function fail, Workflow Service performs exponential backoff retries to notify Step Function service. Number of retries = 3 The total duration of all attempts doesn't exceed 10 seconds, the processing must not exceed the message visibility timeout.

private static final int MAX_RETRIES = 3; private static final int RETRY_DELAY_MS = 2000; private static int attempt = 0; public static void main(String[] args) throws InterruptedException { while (attempt < MAX_RETRIES) { attempt++; System.out.println("Attempting: " + attempt); Thread.sleep(RETRY_DELAY_MS * attempt); } }

Questions about programming?Chat with your personal AI assistant