【发布时间】:2017-10-12 07:22:45
【问题描述】:
我的 Spring Cloud Config Client 依赖于 spring.cloud.starter.bus.amqp,但它仍然没有启用 /bus/refresh endpoint
build.gradle
compile("org.springframework.cloud:spring-cloud-starter-stream-rabbit:1.1.3.RELEASE")
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp:1.2.2.RELEASE")
我的配置客户端应用程序中有这些依赖项,但仍未启用 /bus/refresh、/bus/env。
请让我知道我的客户端应用程序中缺少什么。
注意:
spring.cloud.bus.refresh.enabled: true
spring.cloud.bus.env.enabled: true
endpoints.spring.cloud.bus.refresh.enabled: true
endpoints.spring.cloud.bus.env.enabled: true
我尝试在application.yml 或application.properties 中设置这些指标,因为BusAutoConfiguration 使用这些指标,
启用/bus/* 端点。
@ConditionalOnProperty(value = "endpoints.spring.cloud.bus.refresh.enabled", matchIfMissing = true)
在我的 Spring Cloud Config Server 应用程序中,我禁用了这些端点,即设置为 false
endpoints.spring.cloud.bus.refresh.enabled: false
endpoints.spring.cloud.bus.env.enabled: false
并观察到在 Spring Boot 启动期间 /bus/* 端点未启用。
【问题讨论】:
-
你是在导入 bom 吗? “未启用”是什么意思?你点击它,你得到一个 404,什么?
标签: spring-cloud spring-cloud-config spring-cloud-bus