原创

spring-cloud-2.0集成spring-cloud-bus

1.项目添加maven依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>

2.application.properties新增以下配置

management.endpoints.web.exposure.include=bus-refresh
spring.cloud.bus.enabled=true
spring.cloud.bus.trace.enabled=true


3.配置属性类增加 org.springframework.cloud.context.config.annotation.RefreshScope注解

4.修改属性,刷新配置 /actuator/bus-refresh



正文到此结束
Loading...