Reactor Kafka 繫結器健康指示器

Reactor Kafka Binder 提供了一個 HealthIndicator 實現,該實現將在呼叫 Spring Boot Actuator health 端點時使用。當 classpath 中存在 Spring Boot actuator 依賴項時,可以透過繫結器健康指示器啟用 Reactor Kafka Binder。此健康指示器提供有關基於繫結器的應用程式狀態的資訊,即它當前是 UP 還是 DOWN,應用程式使用的主題,以及繫結器內部使用的訊息生產者元件的各種詳細資訊。

Reactor Kafka Binder 健康指示器由框架內部以鍵 reactorKafka 註冊。因此,可以透過程式設計方式查詢,如下所示。

CompositeHealthContributor compositeHealthContributor = context
			.getBean("bindersHealthContributor", CompositeHealthContributor.class);
ReactorKafkaBinderHealthIndicator healthIndicator = (ReactorKafkaBinderHealthIndicator) compositeHealthContributor.getContributor("reactorKafka");
Health health = healthIndicator.health();
© . This site is unofficial and not affiliated with VMware.