当前位置:   article > 正文

springboot2.3.7升级3.0配置变更点_srping-rabbit3.0升级需要改什么?

srping-rabbit3.0升级需要改什么?

1、spring-boot-starter-data-redis

从原来的spring.redis变为spring.data.redis
老:

@ConfigurationProperties(prefix = "spring.redis")
public class RedisProperties {
  • 1
  • 2

新:

@ConfigurationProperties(prefix = "spring.data.redis")
public class RedisProperties {
  • 1
  • 2

2、spring-cloud-openfeign

从原来的feign.client变为spring.cloud.openfeign.client;
老:

@ConfigurationProperties("feign.client")
public class FeignClientProperties {
  • 1
  • 2

新:

@ConfigurationProperties("spring.cloud.openfeign.client")
public class FeignClientProperties {
  • 1
  • 2

从原来的feign.httpclient变为spring.cloud.openfeign.httpclient;
老:

@ConfigurationProperties(prefix = "feign.httpclient")
public class FeignHttpClientProperties {
  • 1
  • 2

新:

@ConfigurationProperties(prefix = "spring.cloud.openfeign.httpclient")
public class FeignHttpClientProperties {
  • 1
  • 2

3、pom文件需要引入新的dependency

1)、spring-cloud-starter-bootstrap
2)、spring-cloud-starter-loadbalancer,因为ribbon不默认和openfeign一起引入了,这里负载均衡选择的loadbalancer,当前其他的也可以。

		<dependency>
		    <groupId>org.springframework.cloud</groupId>
		    <artifactId>spring-cloud-starter-bootstrap</artifactId>
		</dependency>
		<dependency>
		    <groupId>org.springframework.cloud</groupId>
		    <artifactId>spring-cloud-starter-loadbalancer</artifactId>
		</dependency>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/942693
推荐阅读
相关标签
  

闽ICP备14008679号