Spring启动执行器:在应用程序启动之前ReadinessState更改为ACCEPTING_TRAFFIC
我的 Spring Boot 应用程序包含 Spring Cloud Stream。在应用程序启动之前,Spring Cloud Stream 需要一段时间才能连接到代理。
因此当前序列
- Spring Boot Actuator 的 ReadinessState 更改为 ACCEPTING_TRAFFIC
- 等待 Spring Cloud Stream Broker
- Application Starts。
- 调试日志再次显示 ReadinessState 从 ACCEPTING_TRAFFIC 更改为 ACCEPTING_TRAFFIC
我不想在步骤 1 中声明为 ACCEPTING_TRAFFIC,因为那时应用程序尚未启动。我在这里错过了什么吗?
我添加了以下应用程序属性,没有其他配置
management.endpoint.health.probes.enabled=true
management.health.livenessState.enabled=true
management.health.readinessState.enabled=true
My spring boot app includes Spring Cloud Stream. Before the application boot it takes time for Spring Cloud Stream to connect to broker.
So the current sequence
- Spring Boot Actuator's ReadinessState changed to ACCEPTING_TRAFFIC
- Wait for Spring Cloud Stream Broker
- Application Starts.
- Again a debug log saying that ReadinessState changed from ACCEPTING_TRAFFIC to ACCEPTING_TRAFFIC
I don't want to state to be ACCEPTING_TRAFFIC on step 1 because application has not started by then. Am I missing something here?
I have added following application properties, and no other configuration
management.endpoint.health.probes.enabled=true
management.health.livenessState.enabled=true
management.health.readinessState.enabled=true
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论