Feign
RetryableException
Read Timeout
Java
GET Request

feign.RetryableException: Read timed out executing GET

Codemia Knowledge Hub ·

feign.RetryableException: Read timed out executing GET means Feign sent the request but did not receive a response within the configured read timeout. Feign treats this as a communication failure that a retry might fix. The usual causes are a slow or overloaded server, an unstable network, or a timeout set too low for the endpoint.

Feign is a declarative HTTP client for Java that hides most of the work of calling remote services, so this exception is often the first sign that a remote call is slow.

What the exception means

RetryableException is raised during request execution when Feign's retry mechanism is triggered, signalling a failure that may succeed on a retry. "Read timed out" means the failure happened in the read phase: the request was sent and acknowledged by the server, Feign waited for the response, and the configured period elapsed first.

Common causes

  1. Network issues: unstable connections delay responses.
  2. Server load: an overloaded server takes longer to process requests.
  3. Configuration errors: a read timeout set too low in the HTTP client configuration times out prematurely.
  4. Faulty endpoints: unresponsive or broken APIs on the server side.

Ways to reduce read timeouts

Tuning Feign's configuration and timeouts reduces how often you see RetryableException:

  • Increase timeout values: use a longer read timeout if the API is known to be slow. With Spring Cloud OpenFeign, set it in application.yml (milliseconds; replace default with a client name to target one client):
yaml
1spring:
2  cloud:
3    openfeign:
4      client:
5        config:
6          default:
7            connectTimeout: 5000
8            readTimeout: 10000
  • Load testing: find bottlenecks and tune the API or client configuration.
  • Monitoring: watch for anomalies in response times or server load.
  • Circuit breakers: prevent cascading failures and handle intermittent timeouts gracefully.
  • Caching: cut repeated requests to endpoints that rarely change.
  • Alternative APIs: use alternative endpoints or mirror sites if feasible.
  • Connection pooling: reuse connections in the underlying HTTP client for better performance.

Course
Intermediate
27 lessons
14 hours
OOD Fundamentals

Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.

View the course
Data Structures & Algorithms practice on Codemia

Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.

Practice algorithms