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.

@Override public void handle(WorkflowExecutionEvent event, Error error, StepFunctionRetryer retryer) { // The processing must not exceed the message visibility timeout if (System.currentTimeMillis() < event.getMessage().getExpectedExecutionTimeInSeconds() * 1000) { try { retryer.retry(event, error); } catch (Exception e) { // This exception is thrown if the maximum number of retries has been exhausted. // At this point we can decide to fail the step function execution or to retry the execution again. // We can also use the retryer.retry(event, error, delayInSeconds) method to control the delay for the next retry. // The delays are calculated using an exponential backoff algorithm. retryer.retry(event, error); } } }

Questions about programming?Chat with your personal AI assistant