This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push:
new 1c3524ce6f [ENHANCEMENT] Enable configuring OpenSearch timeout (#2867)
1c3524ce6f is described below
commit 1c3524ce6ff228cb858820dfc264f9190047cbe8
Author: Benoit TELLIER <[email protected]>
AuthorDate: Sat Nov 29 07:19:49 2025 +0100
[ENHANCEMENT] Enable configuring OpenSearch timeout (#2867)
---
.../org/apache/james/backends/opensearch/OpenSearchConfiguration.java | 4 ++++
docs/modules/servers/partials/configure/opensearch.adoc | 3 +++
src/site/xdoc/server/config-opensearch.xml | 3 +++
3 files changed, 10 insertions(+)
diff --git
a/backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/OpenSearchConfiguration.java
b/backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/OpenSearchConfiguration.java
index 84f92ab2f1..5a2eaf96db 100644
---
a/backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/OpenSearchConfiguration.java
+++
b/backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/OpenSearchConfiguration.java
@@ -38,6 +38,7 @@ import
org.apache.commons.configuration2.ex.ConfigurationException;
import
org.apache.james.backends.opensearch.OpenSearchConfiguration.SSLConfiguration.HostNameVerifier;
import
org.apache.james.backends.opensearch.OpenSearchConfiguration.SSLConfiguration.SSLTrustStore;
import
org.apache.james.backends.opensearch.OpenSearchConfiguration.SSLConfiguration.SSLValidationStrategy;
+import org.apache.james.util.DurationParser;
import org.apache.james.util.Host;
import com.google.common.annotations.VisibleForTesting;
@@ -444,6 +445,7 @@ public class OpenSearchConfiguration {
public static final String OPENSEARCH_NB_SHARDS = "opensearch.nb.shards";
public static final String OPENSEARCH_RETRY_CONNECTION_MIN_DELAY =
"opensearch.retryConnection.minDelay";
public static final String OPENSEARCH_RETRY_CONNECTION_MAX_RETRIES =
"opensearch.retryConnection.maxRetries";
+ public static final String OPENSEARCH_REQUEST_TIMEOUT =
"opensearch.request.timeout";
public static final String OPENSEARCH_MAX_CONNECTIONS =
"opensearch.max.connections";
public static final String OPENSEARCH_MAX_CONNECTIONS_PER_HOSTS =
"opensearch.max.connections.per.hosts";
public static final String OPENSEARCH_SEARCH_OVERRIDES =
"opensearch.search.overrides";
@@ -475,6 +477,8 @@ public class OpenSearchConfiguration {
.waitForActiveShards(configuration.getInteger(WAIT_FOR_ACTIVE_SHARDS,
DEFAULT_WAIT_FOR_ACTIVE_SHARDS))
.minDelay(Optional.ofNullable(configuration.getInteger(OPENSEARCH_RETRY_CONNECTION_MIN_DELAY,
null)))
.maxRetries(Optional.ofNullable(configuration.getInteger(OPENSEARCH_RETRY_CONNECTION_MAX_RETRIES,
null)))
+
.requestTimeout(Optional.ofNullable(configuration.getString(OPENSEARCH_REQUEST_TIMEOUT,
null))
+ .map(DurationParser::parse))
.maxConnections(Optional.ofNullable(configuration.getInteger(OPENSEARCH_MAX_CONNECTIONS,
null)))
.maxConnectionsPerHost(Optional.ofNullable(configuration.getInteger(OPENSEARCH_MAX_CONNECTIONS_PER_HOSTS,
null)))
.withSearchOverrides(Optional.ofNullable(configuration.getStringArray(OPENSEARCH_SEARCH_OVERRIDES)).map(ImmutableList::copyOf).orElse(ImmutableList.of()))
diff --git a/docs/modules/servers/partials/configure/opensearch.adoc
b/docs/modules/servers/partials/configure/opensearch.adoc
index 970c33550f..60a2a9bd29 100644
--- a/docs/modules/servers/partials/configure/opensearch.adoc
+++ b/docs/modules/servers/partials/configure/opensearch.adoc
@@ -62,6 +62,9 @@ You may consult the
https://www.elastic.co/guide/en/elasticsearch/reference/7.10
| opensearch.retryConnection.minDelay
| Minimum delay between connection attempts
+| opensearch.request.timeout
+| Request timeout. Duration. Optional. Default value 30s.
+
| opensearch.max.connections
| Maximum count of HTTP connections allowed for the OpenSearch driver.
Optional integer, if unspecified driver defaults
applies (30 connections).
diff --git a/src/site/xdoc/server/config-opensearch.xml
b/src/site/xdoc/server/config-opensearch.xml
index 7774751a73..2f08a32a07 100644
--- a/src/site/xdoc/server/config-opensearch.xml
+++ b/src/site/xdoc/server/config-opensearch.xml
@@ -61,6 +61,9 @@
Ignore opensearch.user and opensearch.password to not be using
authentication (default behaviour).
Otherwise, you need to specify both properties.
</dd>
+
+ <dt><strong>opensearch.request.timeout</strong></dt>
+ <dd>Request timeout. Duration. Optional. Default value 30s.</dd>
</dl>
Or you can connect a cluster by :
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]