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.

int retryCount = 0; while (retryCount <= 3) { try { // Attempt to send request to Step Function break; } catch (SdkClientException e) { retryCount++; final int pause = (int) (Math.pow(2, retryCount) * 100); Thread.sleep(pause); // Re-throw if retryCount is 3 if (retryCount == 3) { throw e; } } }

Questions about programming?Chat with your personal AI assistant