You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2024/12/16 08:54:52 UTC
(streampipes) branch fix-influx-client created (now 12a53ceef9)
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a change to branch fix-influx-client
in repository https://gitbox.apache.org/repos/asf/streampipes.git
at 12a53ceef9 fix: Reuse Influx connection pool
This branch includes the following new commits:
new 12a53ceef9 fix: Reuse Influx connection pool
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(streampipes) 01/01: fix: Reuse Influx connection pool
Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch fix-influx-client
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 12a53ceef9d25e2ff2f0a2cf0378a98d8c085d87
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Mon Dec 16 09:54:38 2024 +0100
fix: Reuse Influx connection pool
---
.../streampipes/dataexplorer/influx/client/InfluxClientUtils.java | 4 ++++
1 file changed, 4 insertions(+)
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 @@ package org.apache.streampipes.dataexplorer.influx.client;
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 class InfluxClientUtils {
public static OkHttpClient.Builder getHttpClientBuilder() {
return new OkHttpClient().newBuilder()
+ .connectionPool(connectionPool)
.connectTimeout(120, TimeUnit.SECONDS)
.readTimeout(120, TimeUnit.SECONDS)
.writeTimeout(120, TimeUnit.SECONDS);