Skip to content

Commit f3eb842

Browse files
committed
Re-add ResourceAccessException into Spring AI Retry policy
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
1 parent ce7381c commit f3eb842

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

auto-configurations/common/spring-ai-autoconfigure-retry/src/main/java/org/springframework/ai/retry/autoconfigure/SpringAiRetryAutoConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.springframework.lang.NonNull;
4242
import org.springframework.util.CollectionUtils;
4343
import org.springframework.util.StreamUtils;
44+
import org.springframework.web.client.ResourceAccessException;
4445
import org.springframework.web.client.ResponseErrorHandler;
4546

4647
/**
@@ -65,6 +66,7 @@ public RetryTemplate retryTemplate(SpringAiRetryProperties properties) {
6566
RetryPolicy retryPolicy = RetryPolicy.builder()
6667
.maxAttempts(properties.getMaxAttempts())
6768
.includes(TransientAiException.class)
69+
.includes(ResourceAccessException.class)
6870
.delay(properties.getBackoff().getInitialInterval())
6971
.multiplier(properties.getBackoff().getMultiplier())
7072
.maxDelay(properties.getBackoff().getMaxInterval())

0 commit comments

Comments
 (0)