Last active
January 26, 2017 22:09
-
-
Save GuiSim/04a006e65831314f8cf7cf66843d2740 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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