|
@@ -21,7 +21,7 @@ import java.util.Objects;
|
|
|
@Component
|
|
|
public class HttpClient {
|
|
|
@Resource
|
|
|
- private RestTemplate restTemplate;
|
|
|
+ private RetryRestTemplate restTemplate;
|
|
|
/**
|
|
|
* 数据交换
|
|
|
* @param request 请求
|
|
@@ -30,7 +30,7 @@ public class HttpClient {
|
|
|
public ResponseEntity<String> exchange(HttpApiRequest request){
|
|
|
ResponseEntity<String> responseEntity = null;
|
|
|
try {
|
|
|
- return restTemplate.exchange(request.getUrl(),
|
|
|
+ return restTemplate.restTemplate().exchange(request.getUrl(),
|
|
|
Objects.requireNonNull(HttpMethod.resolve(request.getMethod())),
|
|
|
new HttpEntity<>(request.getPayload()),
|
|
|
String.class);
|