1.Feign调用报错
升级Spring Boot 2.1.0 Spring Cloud Greenwich.M1 版本后,在2个Feign接口类内定义相同的名字, @FeignClient(name = 相同的名字 就会出现报错,在之前的版本不会提示报错,报错内容为The bean 'XXX.FeignClientSpecification', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.
解决:
在application.yml中配置:
spring:
main:
allow-bean-definition-overriding: true
在SpringBoot 2.1之前,这个配置默认就是true,而在2.1做了更改。
设置为true后,因为FeignClientSpecification的原因,FeignClient注解的configuration参数会被覆盖。
或者不要分多个类
2.ResponseBodyAdvice实现全局输出时,返回值为null是不触发
解决:自定义HttpMessageConverters后解决