Deprecate Elasticsearch transport and Jest clients
As of Spring Data Moore, the Elasticsearch high level REST client is supported for Spring Data repositories. The transport client is now deprecated and is likely to be removed in a future Spring Data release. This commit deprecates the transport client and marks all the associated configuration properties as deprecated. The Spring Boot starter depends on the `spring-data-elasticsearch` project, which now depends on both transport client and high level REST client. This commit also deprecates the Jest client, as Spring Boot will focus on supporting the high level REST client and the reactive client provided by Spring Data - both being in sync with the fast release pace of Elasticsearch. Closes gh-15008
This commit is contained in:
parent
fe9da06a7e
commit
b35424478b
|
|
@ -37,12 +37,14 @@ import org.springframework.data.elasticsearch.client.TransportClientFactoryBean;
|
|||
* @author Mohsin Husen
|
||||
* @author Andy Wilkinson
|
||||
* @since 1.1.0
|
||||
* @deprecated since 2.2.0 in favor of other auto-configured Elasticsearch clients
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass({ Client.class, TransportClientFactoryBean.class })
|
||||
@ConditionalOnProperty(prefix = "spring.data.elasticsearch", name = "cluster-nodes",
|
||||
matchIfMissing = false)
|
||||
@EnableConfigurationProperties(ElasticsearchProperties.class)
|
||||
@Deprecated
|
||||
public class ElasticsearchAutoConfiguration {
|
||||
|
||||
private final ElasticsearchProperties properties;
|
||||
|
|
|
|||
|
|
@ -42,11 +42,13 @@ import org.springframework.util.Assert;
|
|||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.4.0
|
||||
* @deprecated since 2.2.0 in favor of other auto-configured Elasticsearch clients
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(JestClient.class)
|
||||
@EnableConfigurationProperties(JestProperties.class)
|
||||
@AutoConfigureAfter(GsonAutoConfiguration.class)
|
||||
@Deprecated
|
||||
public class JestAutoConfiguration {
|
||||
|
||||
@Bean(destroyMethod = "shutdownClient")
|
||||
|
|
|
|||
|
|
@ -305,6 +305,30 @@
|
|||
"level": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.data.elasticsearch.cluster-name",
|
||||
"type": "java.lang.String",
|
||||
"description": "Elasticsearch cluster name.",
|
||||
"deprecation": {
|
||||
"reason": "The transport client support is deprecated. Use other supported clients instead."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.data.elasticsearch.cluster-nodes",
|
||||
"type": "java.lang.String",
|
||||
"description": "Comma-separated list of cluster node addresses.",
|
||||
"deprecation": {
|
||||
"reason": "The transport client support is deprecated. Use other supported clients instead."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.data.elasticsearch.properties",
|
||||
"type": "java.util.Map<java.lang.String,java.lang.String>",
|
||||
"description": "Additional properties used to configure the client.",
|
||||
"deprecation": {
|
||||
"reason": "The transport client support is deprecated. Use other supported clients instead."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.data.elasticsearch.repositories.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
|
|
@ -389,7 +413,10 @@
|
|||
"name": "spring.elasticsearch.jest.uris",
|
||||
"defaultValue": [
|
||||
"http://localhost:9200"
|
||||
]
|
||||
],
|
||||
"deprecation": {
|
||||
"reason": "The Jest client support is deprecated. Use other supported clients instead."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.elasticsearch.rest.uris",
|
||||
|
|
|
|||
|
|
@ -4782,17 +4782,18 @@ https://www.elastic.co/products/elasticsearch[Elasticsearch] is an open source,
|
|||
distributed, RESTful search and analytics engine. Spring Boot offers basic
|
||||
auto-configuration for Elasticsearch.
|
||||
|
||||
Spring Boot supports several HTTP clients:
|
||||
Spring Boot supports several clients:
|
||||
|
||||
* The official Java "Low Level" and "High Level" REST clients
|
||||
* https://github.com/searchbox-io/Jest[Jest]
|
||||
|
||||
The transport client is still being used by
|
||||
https://github.com/spring-projects/spring-data-elasticsearch[Spring Data Elasticsearch],
|
||||
which you can start using with the `spring-boot-starter-data-elasticsearch` "`Starter`".
|
||||
The transport client is still available but its support has been deprecated in
|
||||
https://github.com/spring-projects/spring-data-elasticsearch[Spring Data Elasticsearch]
|
||||
and will be removed in a future release. Spring Boot provides a dedicated "`Starter`",
|
||||
`spring-boot-starter-data-elasticsearch`.
|
||||
|
||||
[[boot-features-connecting-to-elasticsearch-rest]]
|
||||
==== Connecting to Elasticsearch by REST clients
|
||||
==== Connecting to Elasticsearch using REST clients
|
||||
Elasticsearch ships
|
||||
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html[two different REST clients]
|
||||
that you can use to query a cluster: the "Low Level" client and the "High Level" client.
|
||||
|
|
@ -4819,7 +4820,10 @@ any existing `RestClient` bean, reusing its HTTP configuration.
|
|||
|
||||
|
||||
[[boot-features-connecting-to-elasticsearch-jest]]
|
||||
==== Connecting to Elasticsearch by Using Jest
|
||||
==== Connecting to Elasticsearch using Jest
|
||||
Now that Spring Boot supports the official `RestHighLevelClient`, Jest support is
|
||||
deprecated.
|
||||
|
||||
If you have `Jest` on the classpath, you can inject an auto-configured `JestClient` that
|
||||
by default targets `http://localhost:9200`. You can further tune how the client is
|
||||
configured, as shown in the following example:
|
||||
|
|
|
|||
Loading…
Reference in New Issue