Skip to content

Commit

Permalink
Add socket timeout config for the hotrod client
Browse files Browse the repository at this point in the history
(cherry picked from commit 8a16314)
  • Loading branch information
ataxexe authored and gsmet committed Aug 27, 2024
1 parent 4f554ac commit 544c350
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void infinispanConnectionConfiguration() {
assertThat(configuration.security().ssl().ciphers()).containsExactlyInAnyOrder("SSL_cipher1", "SSL_cipher2");
assertThat(configuration.security().ssl().hostnameValidation()).isTrue();
assertThat(configuration.security().ssl().sniHostName()).isEqualTo("sniHostName");
assertThat(configuration.socketTimeout()).isEqualTo(10000);
assertThat(configuration.clusters()).extracting("clusterName", "clientIntelligence")
.containsExactly(tuple("bsite", ClientIntelligence.BASIC));
assertThat(configuration.clusters()).hasSize(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ quarkus.infinispan-client.ssl-protocol=SSL_protocol
quarkus.infinispan-client.ssl-ciphers=SSL_cipher1,SSL_cipher2
quarkus.infinispan-client.ssl-host-name-validation=true
quarkus.infinispan-client.sni-host-name=sniHostName
quarkus.infinispan-client.socket-timeout=10000

quarkus.infinispan-client.backup-cluster.bsite.hosts=bsite1:32111
quarkus.infinispan-client.backup-cluster.bsite.client-intelligence=BASIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ private ConfigurationBuilder builderFromProperties(String infinispanClientName,
properties.put(ConfigurationProperties.SNI_HOST_NAME, infinispanClientRuntimeConfig.sniHostName.get());
}

if (infinispanClientRuntimeConfig.socketTimeout.isPresent()) {
properties.put(ConfigurationProperties.SO_TIMEOUT, infinispanClientRuntimeConfig.socketTimeout.get());
}

builder.withProperties(properties);

if (infinispanClientRuntimeConfig.tracingPropagationEnabled.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ public class InfinispanClientRuntimeConfig {
@ConfigItem
Optional<String> sniHostName;

/**
* Configures the socket timeout.
*/
@ConfigItem
Optional<Integer> socketTimeout;

/**
* Whether a tracing propagation is enabled in case the Opentelemetry extension is present.
* By default the propagation of the context is propagated from the client to the Infinispan Server.
Expand Down

0 comments on commit 544c350

Please sign in to comment.