Reactor Kafka バインダーヘルスインジケーター

Reactor Kafka バインダーは、Spring Boot Actuator health エンドポイントを呼び出すときに使用される HealthIndicator 実装を提供します。Spring Boot アクチュエーター依存関係がクラスパス上にある場合、Reactor Kafka バインダーをバインダーヘルスインジケータで有効にすることができます。このヘルスインジケータは、バインダーベースのアプリケーションのステータス (現在 UP か DOWN か)、アプリケーションで使用されているトピック、バインダーが内部で使用するメッセージプロデューサーコンポーネントに関するさまざまな詳細に関する情報を提供します。

Reactor Kafka バインダーヘルスインジケーターは、フレームワークによってキー reactorKafka で内部的に登録されます。以下に示すようにプログラムでクエリできます。

CompositeHealthContributor compositeHealthContributor = context
			.getBean("bindersHealthContributor", CompositeHealthContributor.class);
ReactorKafkaBinderHealthIndicator healthIndicator = (ReactorKafkaBinderHealthIndicator) compositeHealthContributor.getContributor("reactorKafka");
Health health = healthIndicator.health();