OkHttp connect and read timeouts overwritten by feign
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 41
Description
The connect and read timeout configuration in the OkHttpClient is overwritten by feign in the code below when no options are set in feign.
Is there any specific reason to do it?
This is some code example where the OkHttpClient timeout configuration is ignored and the default feign values are used instead.
OkHttpClient client = unsafeHttpClient().newBuilder()
.readTimeout(130, TimeUnit.SECONDS)
.writeTimeout(130, `TimeUnit.SECONDS)
.build();
return Feign.builder()
.errorDecoder(new EdocErrorDecoder(objectMapper()))
.encoder(new FormEncoder())
.decoder(new JacksonDecoder(objectMapper()))
.logger(new Slf4jLogger())
.client(new feign.okhttp.OkHttpClient(client))
.target(MyService.class, myServiceUrl);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at okhttp/src/main/java/feign/okhttp/OkHttpClient.java around line 158 and reproduce the supplied Feign.builder example with a preconfigured OkHttpClient. Compare the resulting timeouts when no Feign options are set; done means the configured OkHttpClient timeouts are no longer unexpectedly overwritten, or the intentional override is clearly established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100