spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Replacement for Spring Retry’s `@Recover`?

Open zyro23 opened this issue 1 month ago • 5 comments

given the core Resilience Features supersede spring-retry, is there a replacement for the spring-retry @Recover functionality?

ref. https://github.com/spring-projects/spring-retry?tab=readme-ov-file#declarative-example

@Retryable(retryFor = RemoteAccessException.class)
public void service() {
    // ... do something
}
@Recover
public void recover(RemoteAccessException e) {
   // ... panic
}

from what i understand, the retry support in core is intentionally minimal but as spring-retry is in the attic/maintenance-only now, having to fall back to Programmatic Retry Support (i.e. RetryTemplate) would be a step backwards in my opinion.

if i am not missing something and there is no replacement (yet), please consider this issue a feature-/enhancement-request to add it.

thanks & regards.

zyro23 avatar Oct 24 '25 07:10 zyro23