让我先说我没有直接使用 Spring Cloud Config,它是通过 Spring Cloud Hystrix starter 传递的。
仅使用时@EnableHystrix
,Spring Cloud 还会尝试定位配置服务器,但预期不成功,因为我没有使用。据我所知,该应用程序运行良好,但问题在于状态检查。健康显示DOWN
是因为没有配置服务器。
浏览项目的源代码,我希望spring.cloud.config.enabled=false
禁用此功能链,但这不是我所看到的。
升级到1.0.0.RC1
(添加此属性)并使用后@EnableCircuitBreaker
:
{
status: "DOWN",
discovery: {
status: "DOWN",
discoveryClient: {
status: "DOWN",
error: "org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.cloud.client.discovery.DiscoveryClient] is defined"
}
},
diskSpace: {
status: "UP",
free: 358479622144,
threshold: 10485760
},
hystrix: {
status: "UP"
},
configServer: {
status: "DOWN",
error: "org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http: //localhost: 8888/bootstrap/default/master":Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect"
}
}
检查 configprops 端点后,似乎我的属性被覆盖了。请注意,父级启用了 configClient。
parent: {
configClientProperties: {
prefix: "spring.cloud.config",
properties: {
password: null,
discovery: {
enabled: false,
serviceId: "CONFIGSERVER"
},
name: "bootstrap",
label: "master",
env: "default",
uri: "http://localhost:8888",
enabled: true,
failFast: false,
username: null
}
}
},
configClientProperties: {
prefix: "spring.cloud.config",
properties: {
password: null,
discovery: {
enabled: false,
serviceId: "CONFIGSERVER"
},
name: "bootstrap",
label: "master",
env: "default",
uri: "http://localhost:8888",
enabled: false,
failFast: false,
username: null
}
}
如果我似乎没有正确执行此操作,任何方向都将不胜感激。