diff --git a/streampipes-data-explorer-influx/src/main/java/org/apache/streampipes/dataexplorer/influx/client/InfluxClientUtils.java b/streampipes-data-explorer-influx/src/main/java/org/apache/streampipes/dataexplorer/influx/client/InfluxClientUtils.java index 9b0d14d1ce..40f67fd780 100644 --- a/streampipes-data-explorer-influx/src/main/java/org/apache/streampipes/dataexplorer/influx/client/InfluxClientUtils.java +++ b/streampipes-data-explorer-influx/src/main/java/org/apache/streampipes/dataexplorer/influx/client/InfluxClientUtils.java @@ -20,12 +20,15 @@ import org.apache.streampipes.dataexplorer.influx.auth.AuthInterceptor; +import okhttp3.ConnectionPool; import okhttp3.OkHttpClient; import java.util.concurrent.TimeUnit; public class InfluxClientUtils { + private static final ConnectionPool connectionPool = new ConnectionPool(10, 10, TimeUnit.MINUTES); + public static OkHttpClient.Builder getHttpClientBuilder(String authToken) { var builder = getHttpClientBuilder() .addInterceptor(new AuthInterceptor(authToken)); @@ -35,6 +38,7 @@ public static OkHttpClient.Builder getHttpClientBuilder(String authToken) { public static OkHttpClient.Builder getHttpClientBuilder() { return new OkHttpClient().newBuilder() + .connectionPool(connectionPool) .connectTimeout(120, TimeUnit.SECONDS) .readTimeout(120, TimeUnit.SECONDS) .writeTimeout(120, TimeUnit.SECONDS);