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