负载均衡组件Spring Cloud Ribbon(三)- Ribbon独立使用配置整合

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shenzhen_zsw/article/details/89447167

目录

负载均衡组件Spring Cloud Ribbon(三)- Ribbon独立使用配置整合

引入依赖

添加listOfServers配置


负载均衡组件Spring Cloud Ribbon(三)- Ribbon独立使用配置整合

服务消费者接入Ribbon(脱离Eureka)

很多旧项目并不是配合Eureka使用,可能也不是SpringCloud开发的,这种情况下就需要单独的集成Ribbon。想要达到的架构效果如下:

引入依赖

<dependency>
     <groupId>org.springframework.cloud</groupId>
     <artifactId>spring-cloud-starter-ribbon</artifactId>
 </dependency>

添加listOfServers配置

此处listOfServers为名字叫microservice-provider-user的Ribbon客户端设置请求的地址列表,即服务提供方的地址列表。

==============================

QQ群:143522604

群里有相关资源

欢迎和大家一起学习、交流、提升!

==============================

猜你喜欢

转载自blog.csdn.net/shenzhen_zsw/article/details/89447167