Auto-configure Elasticsearch REST client in Spring Data
This commit auto-configures the Elasticsearch REST client support as a template for Spring Data Elasticsearch. As of this commit, using the transport client is still possible but developers should migrate. This commit also removes the deprecated annotation on the Elasticsearch auto-configuration for the transport client, since this deprecation notice is already present on the configuration property. Closes gh-17024 Closes gh-16542
This commit is contained in:
@@ -26,16 +26,20 @@ import java.time.Duration;
|
||||
public class ElasticsearchContainer extends Container {
|
||||
|
||||
public ElasticsearchContainer() {
|
||||
super("elasticsearch:6.4.3", 9200,
|
||||
super("elasticsearch:6.7.2", 9200,
|
||||
(container) -> container.withStartupTimeout(Duration.ofSeconds(120))
|
||||
.withStartupAttempts(5).withEnv("discovery.type", "single-node")
|
||||
.addExposedPort(9300));
|
||||
.addExposedPorts(9200, 9300));
|
||||
}
|
||||
|
||||
public int getMappedTransportPort() {
|
||||
return getContainer().getMappedPort(9300);
|
||||
}
|
||||
|
||||
public int getMappedHttpPort() {
|
||||
return getContainer().getMappedPort(9200);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
System.setProperty("es.set.netty.runtime.available.processors", "false");
|
||||
|
||||
Reference in New Issue
Block a user