question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JerseyClientConfiguration timeout not properly set on Client object from yaml

See original GitHub issue

Hi 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:closed
  • Created 8 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nickbabcockcommented, Jun 19, 2015

Shot in the dark, do you also have to set the connectionTimeout?

jerseyClient:
  timeout: 3s
  connectionTimeout: 3s
0reactions
arteamcommented, Nov 25, 2015

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found