spring cloud 由Edgware.SR3升級為Finchley需要做的改動
spring boot 版本由1.5.10.RELEASE ==> 2.0.5.RELEASE
spring cloud 版本由Edgware.SR3 ==> Finchley.SR2
1.spring boot版本
Finchley 只與 Spring Boot 2.0.x相容,不支援 Spring Boot 1.5.x。
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
修改為:
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
2.Eureka Server 端
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
修改為:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
3.Eureka Client 端
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
修改為:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
4.Spring Cloud 獲取服務客戶端 IP
在配置檔案中,獲取客戶端ip的方式
${spring.cloud.client.ipAddress}:${server.port}
修改為:
${spring.cloud.client.ip-address}:${server.port}
5.斷路器
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
修改為:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
6.feign
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
</dependency>
修改為:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
7.zuul
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
</dependency>
修改為:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>
8.HikariCP
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.0.0</version>
</dependency>
9.redis配置(timeout不能為0)
redis:
database: 0
host: 127.0.0.1
port: 6379
password: 123456
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 10000