英文:
Propagate state of Kafka connection to readiness actuator indicator
问题
我有一个基本的Spring Boot服务,通过Kafka发送消息。
当Kafka连接中断时,Spring Boot的actuator
会将Kafka绑定器的状态显示为DOWN
,总体状态显示为DOWN
。然而,Readiness
和Liveness
都显示为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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论