Skip to content

Instantly share code, notes, and snippets.

@GuiSim
Last active January 26, 2017 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GuiSim/04a006e65831314f8cf7cf66843d2740 to your computer and use it in GitHub Desktop.
Save GuiSim/04a006e65831314f8cf7cf66843d2740 to your computer and use it in GitHub Desktop.
public class MyServiceClient {
@Inject
public MyServiceClient(@Named("service.endpoint") Prop<String> endpoint,
@Named("service.readTimeout") Prop<Duration> readTimeout,
HttpClient httpClient) {
this.endpoint = endpoint;
this.readTimeout = readTimeout;
this.httpClient = httpClient;
}
public void getSomething() {
httpClient.post(endpoint.get()).withTimeout(readTimeout.get());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment