public class RetryableException extends FeignException
Response is deemed to be retryable, typically via an
ErrorDecoder when the status is 503.FeignException.BadGateway, FeignException.BadRequest, FeignException.Conflict, FeignException.FeignClientException, FeignException.FeignServerException, FeignException.Forbidden, FeignException.GatewayTimeout, FeignException.Gone, FeignException.InternalServerError, FeignException.MethodNotAllowed, FeignException.NotAcceptable, FeignException.NotFound, FeignException.NotImplemented, FeignException.ServiceUnavailable, FeignException.TooManyRequests, FeignException.Unauthorized, FeignException.UnprocessableEntity, FeignException.UnsupportedMediaType| Constructor and Description |
|---|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Date retryAfter,
Request request)
|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Date retryAfter,
Request request,
byte[] responseBody,
Map<String,Collection<String>> responseHeaders)
|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Long retryAfter,
Request request)
Represents a retryable exception when Retry-After information is available.
|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Long retryAfter,
Request request,
byte[] responseBody,
Map<String,Collection<String>> responseHeaders)
Represents a retryable exception with response body and headers.
|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Request request)
Represents a non-retryable exception when Retry-After information is explicitly not provided.
|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Throwable cause,
Date retryAfter,
Request request)
|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Throwable cause,
Long retryAfter,
Request request)
Represents a retryable exception when Retry-After information is available.
|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Throwable cause,
Long retryAfter,
Request request,
String methodKey)
Represents a retryable exception with methodKey for identifying the method being retried.
|
RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Throwable cause,
Request request)
Represents a non-retryable exception when Retry-After information is explicitly not provided.
|
| Modifier and Type | Method and Description |
|---|---|
Request.HttpMethod |
method() |
String |
methodKey()
Returns the method key identifying the Feign method that was being invoked.
|
Long |
retryAfter()
Sometimes corresponds to the
Util.RETRY_AFTER header present in 503
status. |
content, contentUTF8, errorStatus, errorStatus, hasRequest, request, responseBody, responseHeaders, statusaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Request request)
Use this constructor when the server response does not include a Retry-After header or when retries are not expected.
status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)request - the original HTTP requestpublic RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Throwable cause,
Request request)
Use this constructor when the server response does not include a Retry-After header or when retries are not expected.
status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)cause - the underlying cause of the exceptionrequest - the original HTTP requestpublic RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Throwable cause,
Long retryAfter,
Request request)
Use this constructor when the server response includes a Retry-After header specifying the delay in milliseconds before retrying.
If retryAfter is null, prefer using #RetryableException(int, String,
HttpMethod, Throwable, Request) instead.
status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)cause - the underlying cause of the exceptionretryAfter - the retry delay in milliseconds retryAfter usually corresponds to the Util.RETRY_AFTER header. If you don't want to retry, use #RetryableException(int, String, HttpMethod, Throwable, Request).request - the original HTTP requestpublic RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Throwable cause,
Long retryAfter,
Request request,
String methodKey)
status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)cause - the underlying cause of the exceptionretryAfter - the retry delay in millisecondsrequest - the original HTTP requestmethodKey - the method key identifying the Feign method@Deprecated public RetryableException(int status, String message, Request.HttpMethod httpMethod, Throwable cause, Date retryAfter, Request request)
#RetryableException(int, String, HttpMethod, Throwable, Long, Request)
instead. This constructor uses Date for retryAfter, which has been replaced by
Long.status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)cause - the underlying cause of the exceptionretryAfter - the retry-after time as a Daterequest - the original HTTP requestpublic RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Long retryAfter,
Request request)
Use this constructor when the server response includes a Retry-After header.
status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)retryAfter - the retry delay in milliseconds retryAfter usually corresponds to the Util.RETRY_AFTER header. If you don't want to retry, use #RetryableException(int, String, HttpMethod, Request)request - the original HTTP request@Deprecated public RetryableException(int status, String message, Request.HttpMethod httpMethod, Date retryAfter, Request request)
#RetryableException(int, String, HttpMethod, Long, Request) instead.
This constructor uses Date for retryAfter, which has been replaced by Long.status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)retryAfter - the retry-after time as a Daterequest - the original HTTP requestpublic RetryableException(int status,
String message,
Request.HttpMethod httpMethod,
Long retryAfter,
Request request,
byte[] responseBody,
Map<String,Collection<String>> responseHeaders)
Use this constructor when handling HTTP responses that include Retry-After information.
status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)retryAfter - the retry delay in milliseconds retryAfter usually corresponds to the Util.RETRY_AFTER header.request - the original HTTP requestresponseBody - the HTTP response bodyresponseHeaders - the HTTP response headers@Deprecated public RetryableException(int status, String message, Request.HttpMethod httpMethod, Date retryAfter, Request request, byte[] responseBody, Map<String,Collection<String>> responseHeaders)
#RetryableException(int, String, HttpMethod, Long, Request, byte[],
Map) instead. This constructor uses Date for retryAfter, which has been replaced
by Long.status - the HTTP status codemessage - the exception messagehttpMethod - the HTTP method (GET, POST, etc.)retryAfter - the retry-after time as a Daterequest - the original HTTP requestresponseBody - the HTTP response bodyresponseHeaders - the HTTP response headerspublic Long retryAfter()
Util.RETRY_AFTER header present in 503
status. Other times parsed from an application-specific response. Null if unknown.public Request.HttpMethod method()
public String methodKey()
ErrorDecoder.decode(java.lang.String, feign.Response).Copyright © 2012–2026 OpenFeign. All rights reserved.