本文共 2182 字,大约阅读时间需要 7 分钟。
2019.01.23 期待已久的Spring Cloud Greenwich 发布了release版本,作为我们团队也第一时间把RC版本替换为release,以下为总结,希望对你使用Spring Cloud Greenwich 有所帮助
Greenwich 只支持 Spring Boot 2.1.x 分支。如果使用 2.0.x 请使用Finchley版本,主要是适配JAVA11
org.springframework.boot spring-boot-dependencies 2.1.2.RELEASE pom import org.springframework.cloud spring-cloud-dependencies Greenwich.RELEASE pom import
除了Git、File、JDBC,新版本提供 在Cloud Foundry的CredHub存储功能
spring: profiles: active: credhub cloud: config: server: credhub: url: https://credhub:8844
这里提供了一个例子:
整合的时候有个坑可以参考这个issue:
spring: cloud: gateway: routes: - id: rewriteresponseheader_route uri: http://example.org filters: - RewriteResponseHeader=X-Response-Foo, , password=[^&]+, password=***
对Spring Cloud Finchley 进行直接升级时候发现feign启动报错了
***************************APPLICATION FAILED TO START***************************Description:The bean 'pigx-upms-biz.FeignClientSpecification', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.Action:Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=trueProcess finished with exit code 1
bootstrap.yml
中配置spring.main.allow-bean-definition-overriding=true
这是Spring Boot 2.1 后新增的属性运行bean 覆盖,不要配置到配置中心里面,不然无效
This will be used as the bean name instead of name if present, but will not be used as a service id.
就可以用这个属性区分@FeigenClient 标志的同一个service 的接口
转载地址:http://ajcol.baihongyu.com/