标签:定义 更新 tor 配置文件 method dep sms nts map
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring‐cloud‐bus</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring‐cloud‐stream‐binder‐rabbit</artifactId>
</dependency>
配置文件
rabbitmq: host: 127.0.0.1 management: #暴露触发消息总线的地址 endpoints: web: exposure: include: bus‐refresh
客户端
引入依赖
<dependency> <groupId>org.springframework.cloud</groupId>
<artifactId>spring‐cloud‐bus</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId>
<artifactId>spring‐cloud‐stream‐binder‐rabbit</artifactId>
</dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring‐boot‐starter‐actuator</artifactId>
</dependency>
配置文件中配置rabbitmq
rabbitmq:
host: 127.0.0.1
测试
@RefreshScope //注解@RefreshScope 此注解用于刷新配置
@RestController
public class TestController {
@Value("${sms.ip}") private String ip; @RequestMapping(value = "/ip", method = RequestMethod.GET)
public String ip() {
return ip;
}
}
标签:定义 更新 tor 配置文件 method dep sms nts map
原文地址:https://www.cnblogs.com/qin1993/p/12573321.html