For some reason, I cannot replicate the retry capabilities stated in the docs in my lambda function at all. I set the Max event age to 1 min, and i set the max retry attempts to 2. Yet when a execute a simple lambda function like below:
if(StringUtils.contains("ERROR_MESSAGE", payload)){
throw new RuntimeException("Example error message");
}
It retries MANY times. Perhaps over 50 times. Is there any way to mimic retry functionality? And why is it retrying so many times?
Also, when using State Machine (Step Function) retries, does it work the same way as using normal retries? If my lambda is triggered by some event source, MSK for example, if the lambda function fails or throws an exception, will it follow the retry scenario specified in the Step Function?