Ensure local Elasticsearch nodes are closed

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
This commit is contained in:
Phillip Webb
2015-02-10 21:14:19 -08:00
parent 5c4b698f86
commit a1cbd93d6b
2 changed files with 31 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 the original author or authors.
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -62,6 +62,6 @@ public class SampleElasticsearchApplication implements CommandLineRunner {
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleElasticsearchApplication.class, "--debug");
SpringApplication.run(SampleElasticsearchApplication.class, "--debug").close();
}
}