You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some DBs hint with specific vendor code or SQLState if a DB request/transaction could be retried in case of exception, e.g. exception instanceof SQLException sqlException && "12345".equals(sqlException.getErrorCode()) . spring-retry can handle this case either with:
Utility class holding the predicate (classifier) + SPeL and ExpressionRetryPolicy - not very fast due to the expression evaluation
Assembling manually RestTemplate with custom RetryPolicy - more error prone and lacks the convenience of RetryTemplate.builder()
Both solutions have drawbacks and mostly lacks the convenience of RetryTemplate.builder().
Do you think it is possible to allow the use of custom (binary) exception classifier in RetryTemplate.builder(). Here is an example to depict the idea:
Some DBs hint with specific vendor code or
SQLState
if a DB request/transaction could be retried in case of exception, e.g.exception instanceof SQLException sqlException && "12345".equals(sqlException.getErrorCode())
.spring-retry
can handle this case either with:ExpressionRetryPolicy
- not very fast due to the expression evaluationRestTemplate
with customRetryPolicy
- more error prone and lacks the convenience ofRetryTemplate.builder()
Both solutions have drawbacks and mostly lacks the convenience of
RetryTemplate.builder()
.Do you think it is possible to allow the use of custom (binary) exception classifier in
RetryTemplate.builder()
. Here is an example to depict the idea:The text was updated successfully, but these errors were encountered: