首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SpringBoot不再包含

SpringBoot不再包含
EN

Stack Overflow用户
提问于 2019-12-16 16:25:37
回答 1查看 259关注 0票数 0

我的应用程序禁用了Elasticsearch健康检查,如下所示:

代码语言:javascript
复制
import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthIndicatorAutoConfiguration;


@SpringBootApplication(exclude = {        
    ElasticSearchRestHealthIndicatorAutoConfiguration.class
})
public class MyApp

它可以很好地与SpringBoot 2.1.8.RELEASE配合使用。但现在我想将我的应用程序升级到SpringBoot 2.2.2.RELEASE。问题是SpringBoot 2.2.2.RELEASE不再包含ElasticSearchRestHealthIndicatorAutoConfiguration类。

如何处理这种情况?应该在SpringBoot 2.2.2.RELEASE而不是ElasticSearchRestHealthIndicatorAutoConfiguration中使用什么来关闭Elasticsearch运行状况检查?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-16 18:58:32

似乎从2.2.0.RELEASE开始,我们需要使用ElasticSearchRestHealthContributorAutoConfiguration而不是ElasticSearchRestHealthIndicatorAutoConfiguration类。

正如在doc中所写的,这些类是使用RestClient为ElasticsearchRestHealthIndicator自动配置的。

其余部分保持不变

代码语言:javascript
复制
import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration;

@SpringBootApplication(exclude = {ElasticSearchRestHealthContributorAutoConfiguration.class})
public class MyApp
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59352819

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档