JerseyClientConfiguration timeout not properly set on Client object from yaml
See original GitHub issueHi all,
AFAICT, dropwizard isn’t actually setting the timeout values for jersey clients when they’re specified in a config file. Here’s my quick example (CatConfiguration is cut down for brevity):
public class CatConfiguration extends Configuration {
@Valid
@NotNull
@JsonProperty("jerseyClient")
private JerseyClientConfiguration jerseyClientConfiguration;
public JerseyClientConfiguration getJerseyClientConfiguration() {
return jerseyClientConfiguration;
}
public void setJerseyClientConfiguration(JerseyClientConfiguration jcc) {
this.jerseyClientConfiguration = jcc;
}
}
Config file contains:
jerseyClient:
timeout: 3s
And when I build it (I’ve tried this with and without the “using” method)
final Client jerseyClient = new JerseyClientBuilder(environment)
.using(catCfg.getJerseyClientConfiguration()).build(getName());
System.out.println("Timeout:");
System.out.println(jerseyClient.getConfiguration().getProperty(ClientProperties.READ_TIMEOUT));
System.out.println(catCfg.getJerseyClientConfiguration().getTimeout());
This prints
Timeout:
null
3 seconds
So seems like it’s read from the config just fine, but not actually set on the client object.
I fairly sure I haven’t messed this up - is the timeout simply failing to be set? Right now I’m just manually setting the timeout as a temporary workaround. Let me know if I’ve done something wrong, otherwise hopefully this is an easy fix. Thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Dropwizard Client - Medium
The configuration should be set in the Dropwizard yaml ... The connection related timeout settings in JerseyClientConfiguration:.
Read more >Dropwizard Client
The Client that Dropwizard creates deviates from the Jersey Client Configuration defaults. The default, in Jersey, is for a client to never timeout...
Read more >Exception in dropwizard service while creating Jersey Client
Hi All,. I am getting the below exception while running my service which is using jersey client.I have tried to get resolved but...
Read more >how to increase jersey WS timeout - java - Stack Overflow
It is waiting on a call which takes around 2 minutes. It is timing out at WS layer. Do I have to increase...
Read more >Dropwizard Documentation - Read the Docs
Note: The mapping from YAML to your application's Configuration instance ... If the string is not a well-formed format string (for example, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Shot in the dark, do you also have to set the
connectionTimeout?I am closing this issue. Without a test case, we can’t do much.
Feel free to open a new issue against Dropwizard 0.8.5/0.9.1, if the problem still exists