Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

java - Upgrade Spring Cloud Hoxton.SR6 to 2020.0.0

I am upgrading Spring Cloud version from Hoxton.SR6 to 2020.0.0 as part of Spring boot version upgrade from 2.3.4.RELEASE to 2.4.2.

<spring-cloud.version>2020.0.0</spring-cloud.version>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Existing code had spring-cloud-sleuth-core dependency which is satisfied by Hoxton.SR6. But for 2020.0.0 this dependency is not available .

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-sleuth-core</artifactId>
</dependency>

What is the alternative dependency for this in 2020.0.0 ?

Update:

org.springframework.cloud.openfeign.ribbon package no longer available in 2020.0.0. What is the alternative for this?

import org.springframework.cloud.openfeign.ribbon.CachingSpringLoadBalancerFactory;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
question from:https://stackoverflow.com/questions/65878482/upgrade-spring-cloud-hoxton-sr6-to-2020-0-0

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You should not depend on spring-cloud-sleuth-core, here's what you need:

  • The Spring Cloud BOM: org.springframework.cloud:spring-cloud-dependencies
  • The Sleuth starter: org.springframework.cloud:spring-cloud-starter-sleuth
  • The Zipkin module (if you want to send traces there): org.springframework.cloud:spring-cloud-sleuth-zipkin

That's all, with these it should work.

Answer for your update: Spring Cloud OpenFeign does not have too much to do with Sleuth, it should be a different question. I think Ribbon was removed, you can use Spring Cloud LoadBalancer instead.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...