相关疑难解决方法(0)

Spring Actuator + Kafka Streams - 将 kafka 流状态添加到健康检查端点

我有一个使用 apache kafka-streams 的 Spring Boot 应用程序。我不使用 spring 云流。我添加了执行器健康检查端点。我是application.yml这样配置的:

management:
  health.db.enabled: false
  endpoints.web:
    base-path:
    path-mapping.health: /
Run Code Online (Sandbox Code Playgroud)

当抛出运行时异常并且我的流被停止时,日志显示但运行状况检查状态为 UP。

2019-09-17 13:16:31.522 INFO 1 --- [ Thread-5] org.apache.kafka.streams.KafkaStreams : stream-client [lpp-model-stream-7e6e8fea-fcad-4033-92a4-5ede50de6e17] Streams client stopped complet伊利

如何将 kafka 流状态绑定到健康检查端点?

我的 pom.xml:

  <dependencies>
            <dependency>
                <groupId>org.springframework.kafka</groupId>
                <artifactId>spring-kafka</artifactId>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-streams</artifactId>
            </dependency>
            <dependency>
                <groupId>data-wizards</groupId>
                <artifactId>lpp-common-avro</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>
            <dependency>
                <groupId>io.confluent</groupId>
                <artifactId>kafka-streams-avro-serde</artifactId>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
            </dependency>
            <dependency> …
Run Code Online (Sandbox Code Playgroud)

spring apache-kafka spring-boot

5
推荐指数
1
解决办法
5122
查看次数

标签 统计

apache-kafka ×1

spring ×1

spring-boot ×1