Easy to use custom retry method implementation.
- You don't have this handled by infrastructure.
- You can't use a library such as
Resilience4J
(https://github.com/resilience4j/resilience4j) orFailsafe
(https://failsafe.dev/).
MyResponse myResponse= new RetryUtils<MyResponse>().retry(()->myService.getById(id),
"myCustomLogInfo",
retryCount,
Arrays.asList(StatusRuntimeException.class,Errors.NativeIoException.class),
MyCustomException.class);