此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 spring-cloud-stream 4.1.4! |
Reactor Kafka Binder 运行状况指示器
Reactor Kafka 活页夹提供了一个HealthIndicator
调用 Spring Boot Actuator 时将使用的实现health
端点。
当 Spring Boot 执行器依赖项位于 Classpath 上时,可以使用 Binder 运行状况指示器启用 Reactor Kafka Binder。
此运行状况指示器提供有关基于 Binder 的应用程序的状态的信息,即它当前是否为UP
或DOWN
、应用程序使用的主题以及有关 Binder 内部使用的消息生成方组件的各种详细信息。
Reactor Kafka Binder Health Indicator 使用键reactorKafka
在框架内部。
因此,可以通过编程方式查询它,如下所示。
CompositeHealthContributor compositeHealthContributor = context
.getBean("bindersHealthContributor", CompositeHealthContributor.class);
ReactorKafkaBinderHealthIndicator healthIndicator = (ReactorKafkaBinderHealthIndicator) compositeHealthContributor.getContributor("reactorKafka");
Health health = healthIndicator.health();