2019.01.23 期待已久的Spring Cloud Greenwich 发布了release版本,作为我们团队也第一时间把RC版本替换为release,以下为总结,希望对你使用Spring Cloud Greenwich 有所帮助 Greenwich 只支持 Spring Boot 2.1.x 分支。如果使用 2.0.x 请使用Finchley版本,
  
  pom坐标
  
  主要是适配JAVA11
  
  <!--支持Spring Boot 2.1.X-->
  
  <dependency>
  
  <groupId>org.springframework.boot</groupId>
  
  <artifactId>spring-boot-dependencies</artifactId>
  
  <version>2.1.2.RELEASE</version>
  
  <type>pom</type>
  
  <scope>import</scope>
  
  </dependency>
  
  <!--Greenwich.RELEASE-->
  
  <dependency>
  
  <groupId>org.springframework.cloud</groupId>
  
  <artifactId>spring-cloud-dependencies< www.ysyl157.com /artifactId>
  
  <version>Greenwich.RELEASE</version>
  
  <type>pom</type>
  
  <scope>import</scope>
  
  </dependency>
  
  升级netflix版本,DiscoveryClient支持获取InstanceId
  
  image
  
  Spring Cloud Config 提供了新的存储介质
  
  除了Git、File、JDBC,新版本提供 在Cloud Foundry的CredHub存储功能
  
  spring:
  
  profiles:
  
  active: credhub
  
  cloud:
  
  config:
  
  server:
  
  credhub:
  
  url: https://credhub:8844
  
  Spring Cloud Gateway
  
  支持整合OAuth2
  
  这里提供了一个例子: Spring Cloud Gateway and Spring Security OAuth2
  
  整合的时候有个坑可以参考这个issue:ReactiveManagementWebSecurityAutoConfiguration Prevent's oauth2Login from being defaulted
  
  新增重写响应头过滤器
  
  spring:
  
  cloud:
  
  gateway:
  
  routes:
  
  - id: rewriteresponseheader_route
  
  uri: http://www.hengda157.com example.org
  
  filters:
  
  - RewriteResponseHeader=X-Response-Foo,www.dasheng178.com , password=[^&]+, password=***
  
  Feign 的新特性和坑
  
  @SpringQueryMap 对Get请求进行了增强
  
  终于解决这个问题了
  
  不用直接使用OpenFeign新增的@QueryMap,由于缺少value属性 QueryMap注释与Spring不兼容...
  
  异常解决
  
  对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 www.wanchuang2.com overriding is disabled.
  
  Action:
  
  Consider renaming one of the beans or enabling overriding by setting spring.main.www.lezongyule.com allow-bean-definition-overriding=true
  
  Process finished with exit code 1
  
  第一种粗暴的解决方法,异常日志中说明了,在 bootstrap.yml中配置
  
  spring.main.allow-bean-definition-overriding=true
  
  这是Spring Boot 2.1 后新增的属性运行bean 覆盖,不要配置到配置中心里面,不然无效
  
  第二种,就是把通过同一个服务调用的代码,移动到同一个@FeignClient中
  
  contextId ,这个是@FeignClient 新增的一个属性
  
  This will be used as the bean name instead of name if present, but will not be used as a service id.
  
  就可以用这个属性区分@FeigenClient 标志的同一个service 的接口
  
  总结
  
  Spring Cloud F -- > G 变化很小,微乎其微主要是JAVA11的兼容
  
  很遗憾没有看到 Spring Cloud Alibaba 加油。
  
  Spring Cloud LoadBalancer 还是老样子。目前来看暂时无法替代 ribbon
  

Spring Cloud Greenwich 新特性和F升级分享的更多相关文章

  1. 【Finchley】【新特性】Spring Cloud Finchley 新特性

    Finchley 正式版的发布貌似经历了相当长的时间,这次的重大发布主要带来了以下 4 项重大更新. 重大更新 1.新增 Spring Cloud Gateway 组件 Spring Cloud Ga ...

  2. Spring Cloud Greenwich 正式发布,Hystrix 即将寿终正寝。。

    Spring Cloud Greenwich 正式版在 01/23/2019 这天正式发布了,下面我们来看下有哪些更新内容. 生命周期终止提醒 Spring Cloud Edgware Edgware ...

  3. Spring Cloud Greenwich.SR4 发布了,跟不上了……

    前几天 Spring Cloud Greenwich.SR4 发布了: https://spring.io/blog/2019/11/19/spring-cloud-greenwich-sr4-rel ...

  4. 我这样回答了Spring 5的新特性,面试官对我刮目相看

    最近,有一个小伙伴拿到了自己满意的Offer,和他交谈的过程中得知他面试官问他关于Spring的问题比较多,其中最让面试官满意的就是自己回答关于Spring 5的知识点回答的不错. Spring5于2 ...

  5. Spring cloud Greenwich Eureka

    1.父工程POM文件中: <dependencyManagement> <dependencies> <!--spring cloud--> <depende ...

  6. 关于Spring Cloud的核心特性

    SOA和微服务的区别 其实服务化架构已经可以解决大部分企业的需求了,那么我们为什么要研究微服务呢?先说说它们的区别: 微服务架构强调业务系统需要彻底的组件化和服务化,一个组件就是一个产品,可以独立对外 ...

  7. 1. Spring Cloud Greenwich SR2 概览

    Spring Cloud provides tools for developers to quickly build some of the common patterns in distribut ...

  8. Exadata 18.1新特性--计算节点升级增强

    新的计算节点升级增强能大幅缩短升级花费的时间,最快能减少40%的时间,具体的增强主要体现在以下方面: 1.计算节点操作系统的备份工作. 以前计算节点操作系统的备份工作是在正式升级之前执行,在滚动升级过 ...

  9. Spring 3.1新特性之三:Spring对声明式缓存的支持

    一.概述: Spring 3.1 引入了激动人心的基于注释(annotation)的缓存(cache)技术,它本质上不是一个具体的缓存实现方案(例如EHCache 或者 OSCache),而是一个对缓 ...

随机推荐

  1. Elasticsearch5.x版本中对Text类型进行聚合时提示illegal_argument_exception

    Having this field in my mapping "answer": { "type": "text", "fiel ...

  2. linux设置定时任务调用接口

    1.设置目录 cd /var/spool/cron 2.编辑文件(当前登录用户,不一定是root) vim root 3.添加内容 0 0 * * * wget http://192.144.141. ...

  3. 【转】微信小程序实现自动化测试

    山雨欲来风满楼,最近微信小程序相关开发文章吹遍大江南北,亦有摧枯拉朽万象更新之势.问小程序形为何物,直教IT众生怡情悦性高潮迭起.作为一名有着远大理想“包袱”与互联网变革 “使命感”的测试工程师,我再 ...

  4. IO多路复用(一)-- Select、Poll、Epoll

    在上一篇博文中提到了五种IO模型,关于这五种IO模型可以参考博文IO模型浅析-阻塞.非阻塞.IO复用.信号驱动.异步IO.同步IO,本篇主要介绍IO多路复用的使用和编程. IO多路复用的概念 多路复用 ...

  5. Blockchain For Dummies(IBM Limited Edition

    Blockchain For Dummies(IBM Limited Edition)笔记 该系列内容主要介绍用于商业的区块链,有人说区块链之于贸易,犹如因特网之于信息.在商业领域区块链可以用于交易任 ...

  6. 2018-2019-20172329 《Java软件结构与数据结构》第四周学习总结

    2018-2019-20172329 <Java软件结构与数据结构>第四周学习总结 经过这样一个国庆节的假期,心中只有一个想法,这个国庆假期放的,不如不放呢!! 教材学习内容总结 < ...

  7. 20162316刘诚昊 第八周实验报告:实验二 Java面向对象程序设计

    实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 了解设计模式 实验要求 1.没有Linux基础的同学建议先学习<L ...

  8. c# 捕获一般获取不到的异常

    1.主函数入口加异常事件,代码例如: /// <summary> /// 应用程序的主入口点. /// </summary> [STAThread] static void M ...

  9. HDU 5862 Counting Intersections 扫描线+树状数组

    题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5862 Counting Intersections Time Limit: 12000/ ...

  10. 第七次java作业

     interface Pet{public String getName();public String getColor();public int getAge();}class Cat imple ...