Created
July 6, 2017 02:17
-
-
Save marciorodrigues87/3a98cb02ca1092a18a71eb04085d7b1f to your computer and use it in GitHub Desktop.
RestTemplateConfigStepFour.java
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
final HttpClient httpClient = HttpClients.custom() | |
.setMaxConnPerRoute(100) | |
.setMaxConnTotal(1000) | |
.setConnectionTimeToLive(30, MINUTES) | |
.setRetryHandler((IOException exception, int executionCount, HttpContext context) -> { // <-- | |
return executionCount <= 3; // <-- | |
}) // <-- | |
.build(); | |
final RestTemplate restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory(httpClient)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment