...
|
...
|
@@ -55,21 +55,8 @@ public class HttpClient { |
|
|
private CloseableHttpClient httpClient;
|
|
|
|
|
|
@PostConstruct
|
|
|
public void init() {
|
|
|
new Thread(() -> {
|
|
|
while (Objects.isNull(httpClient)) {
|
|
|
try {
|
|
|
httpClient = this.buildHttpClient();
|
|
|
} catch (Exception e) {
|
|
|
log.warn("build http client fail, {}", e.getMessage());
|
|
|
}
|
|
|
try {
|
|
|
Thread.sleep(3 * 1000);
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, "http-client-builder-" + this.getClass().getSimpleName()).start();
|
|
|
public void init() throws Exception {
|
|
|
httpClient = this.buildHttpClient();
|
|
|
}
|
|
|
|
|
|
public CloseableHttpClient buildHttpClient() throws Exception {
|
...
|
...
|
|