Update ElasticsearchAutoConfiguration to ensure that local nodes are
closed when the context is closed. Prior to this commit the close()
method of the Client would be called which had no effect for local
Nodes.
Fixes gh-2480
@ -49,13 +55,12 @@ public class ElasticsearchAutoConfiguration implements DisposableBean {
@@ -49,13 +55,12 @@ public class ElasticsearchAutoConfiguration implements DisposableBean {
@Autowired
privateElasticsearchPropertiesproperties;
privateClientclient;
privateReleasablereleasable;
@Bean
publicClientelasticsearchClient(){
try{
this.client=createClient();
returnthis.client;
returncreateClient();
}
catch(Exceptionex){
thrownewIllegalStateException(ex);
@ -70,10 +75,12 @@ public class ElasticsearchAutoConfiguration implements DisposableBean {
@@ -70,10 +75,12 @@ public class ElasticsearchAutoConfiguration implements DisposableBean {
@ -81,18 +88,28 @@ public class ElasticsearchAutoConfiguration implements DisposableBean {
@@ -81,18 +88,28 @@ public class ElasticsearchAutoConfiguration implements DisposableBean {
@ -62,6 +62,6 @@ public class SampleElasticsearchApplication implements CommandLineRunner {
@@ -62,6 +62,6 @@ public class SampleElasticsearchApplication implements CommandLineRunner {