springcloud config bus 通过中心广播到所有client

打开cmd,输入,注意POST前面没有-

curl -X POST "http://localhost:3344/actuator/bus-refresh"

广播到指定客户端,再以上地址加入/应用程序名:端口号

curl -X POST "http://localhost:3344/actuator/bus-refresh/config-client:3355"

在这里插入图片描述

通过MQ广播机制

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Cloud Config Server注册到Eureka注册中心的步骤如下: 1. 首先需要在pom.xml文件中添加Eureka Client的依赖,如下所示: ```xml <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> <version>2.2.1.RELEASE</version> </dependency> ``` 2. 在应用程序的配置文件中添加以下配置: ```yaml eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/ ``` 其中,`defaultZone`指定了Eureka Server的地址。 3. 在Spring Boot应用程序类上添加@EnableEurekaClient注解,以将Config Server注册到Eureka Server上: ```java @EnableConfigServer @EnableDiscoveryClient @SpringBootApplication public class ConfigServerApplication { public static void main(String[] args) { SpringApplication.run(ConfigServerApplication.class, args); } } ``` 4. 运行Config Server应用程序,查看Eureka Server的管理页面(http://localhost:8761)上是否已经注册成功。 5. 客户端应用程序可以通过以下方式从Config Server获取配置: ```yaml spring: application: name: client-service cloud: config: uri: http://localhost:8888 fail-fast: true retry: maxAttempts: 20 multiplier: 1.5 maxInterval: 5000 label: master ``` 其中,`cloud.config.uri`指定了Config Server的地址,`spring.application.name`指定了客户端应用程序的名称,`label`指定了Git仓库的分支名称。 6. 运行客户端应用程序,即可从Config Server获取配置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值