【发布时间】:2018-10-25 03:08:33
【问题描述】:
我有配置服务器,应用程序从该服务器获取配置。 我想设置获取的重试机制。如果配置服务器不可用,应用程序将在 10 分钟内发送请求。
在 spring 文档中我找到了下一个配置
spring.cloud.config.uri=http://localhost:9090
spring.cloud.config.fail-fast=true
spring.cloud.config.retry.max-interval=10000
spring.cloud.config.retry.max-attempts=2000
但他们什么也没改变。我的应用不执行重试请求,只是失败了
Caused by: java.net.ConnectException: Connection refused: connect
(此时配置服务器已关闭)
我做错了什么?有办法解决我的问题吗?
【问题讨论】:
标签: java spring spring-boot kotlin spring-cloud