Enable Jest's multi-threaded support by default

Since the `JestClient` is auto-configured as a bean, it must have its
multi-threaded support enabled by default. This commit exposes a new
`spring.elasticsearch.jest.multi-threaded` property that is `true` by
default.

Closes gh-6806
pull/7763/head
Stephane Nicoll 8 years ago
parent d0fa72a169
commit a60e356136
Notes: Phillip Webb 8 years ago
Fixes gh-7280

@ -81,6 +81,7 @@ public class JestAutoConfiguration {
if (gson != null) {
builder.gson(gson);
}
builder.multiThreaded(this.properties.isMultiThreaded());
return builder.connTimeout(this.properties.getConnectionTimeout())
.readTimeout(this.properties.getReadTimeout()).build();
}

@ -45,6 +45,11 @@ public class JestProperties {
*/
private String password;
/**
* Enable connection requests from multiple execution threads.
*/
private boolean multiThreaded = true;
/**
* Connection timeout in milliseconds.
*/
@ -84,6 +89,14 @@ public class JestProperties {
this.password = password;
}
public boolean isMultiThreaded() {
return this.multiThreaded;
}
public void setMultiThreaded(boolean multiThreaded) {
this.multiThreaded = multiThreaded;
}
public int getConnectionTimeout() {
return this.connectionTimeout;
}

@ -631,6 +631,7 @@ content into your application; rather pick only the properties that you need.
# JEST (Elasticsearch HTTP client) ({sc-spring-boot-autoconfigure}/jest/JestProperties.{sc-ext}[JestProperties])
spring.elasticsearch.jest.connection-timeout=3000 # Connection timeout in milliseconds.
spring.elasticsearch.jest.multi-threaded=true # Enable connection requests from multiple execution threads.
spring.elasticsearch.jest.password= # Login password.
spring.elasticsearch.jest.proxy.host= # Proxy host the HTTP client should use.
spring.elasticsearch.jest.proxy.port= # Proxy port the HTTP client should use.

Loading…
Cancel
Save