diff --git a/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/HttpUtil.java b/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/HttpUtil.java index d081c40de..43e2bea8c 100644 --- a/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/HttpUtil.java +++ b/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/HttpUtil.java @@ -48,6 +48,10 @@ public CloseableHttpClient getHttpClient() { .setSocketTimeout(9 * 60 * 1000) .build(); + public CloseableHttpClient getHttpClientForBatch() { + return httpClientBuilder.setDefaultRequestConfig(requestConfig).build(); + } + private final HttpClientBuilder httpClientBuilderWithTimeout = HttpClients.custom().setDefaultRequestConfig(requestConfig); diff --git a/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/batch/DorisBatchStreamLoad.java b/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/batch/DorisBatchStreamLoad.java index 2961eb92b..0971be081 100644 --- a/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/batch/DorisBatchStreamLoad.java +++ b/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/batch/DorisBatchStreamLoad.java @@ -90,7 +90,7 @@ public class DorisBatchStreamLoad implements Serializable { private final AtomicBoolean started; private volatile boolean loadThreadAlive = false; private AtomicReference exception = new AtomicReference<>(null); - private CloseableHttpClient httpClient = new HttpUtil().getHttpClientWithTimeout(); + private CloseableHttpClient httpClient = new HttpUtil().getHttpClientForBatch(); private BackendUtil backendUtil; public DorisBatchStreamLoad(