public class HttpClientsHelpers extends Object
| Constructor and Description |
|---|
HttpClientsHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static org.springframework.web.client.RestTemplate |
getRestTemplate() |
static MicroserviceRestTemplate |
getRestTemplate(Boolean tryToReconnect,
int tryToReconnectTimes,
int sleepTimeBetweenTrying,
String microserviceName,
String pathToApiResource,
org.springframework.http.HttpMethod httpMethod) |
public static MicroserviceRestTemplate getRestTemplate(Boolean tryToReconnect, int tryToReconnectTimes, int sleepTimeBetweenTrying, String microserviceName, String pathToApiResource, org.springframework.http.HttpMethod httpMethod) throws URISyntaxException
tryToReconnect - true if try to retry failed request to microsrevicetryToReconnectTimes - number of times to try to reconnectmicroserviceName - microservice namepathToApiResource - pathToApiResourcehttpMethod - http methodsleepTimeBetweenTrying - sleep in millias to try to reconnect between failed requests
RestTemplate client can be not thread safe (depend on class implementation)
So, in secured to create a new instance to control result of each requestURISyntaxException - exceptionpublic static org.springframework.web.client.RestTemplate getRestTemplate()
Copyright © 2016. All rights reserved.