LoadBalancer 替换 Ribbon

POM 移除 Ribbon 相关依赖



  https://spring.io/projects/spring-cloud/  官网查看 boot 对应的 cloud 的版本

        
        org.springframework.cloud    
        spring-cloud-dependencies    
        ${spring-cloud.version}    
        pom    
        import
    



    org.springframework.cloud
    spring-cloud-starter-loadbalancer




    org.springframework.boot
    spring-boot-starter-web




    com.alibaba.cloud
    spring-cloud-starter-alibaba-nacos-discovery
    
        
            org.springframework.cloud   
            spring-cloud-starter-netflix-ribbon
        
    

配置文件中禁用 Ribbon

spring:
  application:
    name: order-service
  cloud:
    nacos:
      server-addr: 127.0.0.1:8847
      discovery:
        username: nacos
        password: nacos
        namespace: 5fe640ca-1ed2-496c-97bd-e0bfb7aef639
    # 不使用 Ribbon    
    loadbalancer:
      ribbon:
        enabled: false

你可能感兴趣的:(ribbon,spring,cloud)