传播Kafka连接的状态到就绪性执行器指示器

huangapple go评论77阅读模式
英文:

Propagate state of Kafka connection to readiness actuator indicator

问题

我有一个基本的Spring Boot服务,通过Kafka发送消息。

当Kafka连接中断时,Spring Boot的actuator会将Kafka绑定器的状态显示为DOWN,总体状态显示为DOWN。然而,ReadinessLiveness都显示为UP
然而,我希望将Kafka绑定器的故障状态传播到Readiness指示器。

也就是说,如果Kafka正常运行,我希望localhost:8080/actuator/health/readiness显示为"UP",而当Kafka中断时,我希望localhost:8080/actuator/health/readiness显示为"DOWN",但liveness仍然保持为"UP"

是否可以配置这种行为?

英文:

I have a basic spring boot service that sends messages through Kafka.

When kafka connection is down, spring boot actuator shows the status of kafka binder as DOWN and overall status as DOWN. However, Readiness and Liveness are both UP.
I would like however the down status of kafka binder to be propagated to Readiness indicator.

That means, if kafka is up, I'd like localhost:8080/actuator/health/readiness to show "UP" and when kafka is down, I'd like localhost:8080/actuator/health/readiness to show "DOWN", however liveness should still remain "UP".

Is it possible to configure this behaviour?

答案1

得分: 1

最接近所期望的解决方案我能找到的是:

管理:
  终端点:
    健康:
      组:
        可用性:
          包括: readinessState, binders

然而,无法将 binders 限制为仅适用于 kafka。

英文:

The closest to the desired solution that I could find was:

management:
  endpoint:
    health:
      group:
        readiness:
          include: readinessState, binders

could not, however, limit the binders to kafka only.

huangapple
  • 本文由 发表于 2020年10月1日 22:33:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/64157566.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定