标签:Feign

Sentinel + Feign + Hoxton.SR10 版本冲突 Requested bean is currently in creation: Is there an unresolvable circular reference

Sentinel + Feign + Hoxton.SR10 版本冲突 Requested bean is currently in creation: Is there an unresolvable circular reference

(1)sdk版本 spring-cloud-starter-alibaba-sentinel:2.2.5.RELEASE spring cloud:Hoxton.SR10(Hoxton.SR9以下都正常,Hoxton.SR10与2020.x版本都不行) (2)开启sentinel feign.

Joe.Ye Joe.Ye 2023-04-02
0 0 1
Feign整合Sentinel实现熔断降级处理

Feign整合Sentinel实现熔断降级处理

Sentinel可以整合Feign进行熔断处理。特别是Hystrix宣布不再维护后,可以轻松的切换成这种方案。整合过程与Hystrix类似 加入alibaba-Sentinel依赖 <dependency> <groupId>com.alibaba.cloud</

Joe.Ye Joe.Ye 2023-04-02
0 0 0
Spring Cloud Feign 高级应用

Spring Cloud Feign 高级应用

使用feign进行服务间的调用 服务提供者 (1)创建provider-service服务提供者,添加如下依赖: <dependency> <groupId>org.springframework.boot</groupId> <artif

Joe.Ye Joe.Ye 2023-04-01
0 0 0
Spring Cloud Feign Get请求传对象参数

Spring Cloud Feign Get请求传对象参数

前置说明,有A、B两个服务,A服务调用B服务,B服务接口是Get类型,接受参数对象 feign get请求传对象参数分两种情况 版本在2.1之前,则A服务使用Map map替代对象传给B服务 //A-service @ApiOperation(value = "查询xx", h

Joe.Ye Joe.Ye 2023-04-01
0 0 0
Spring Cloud替换Feign默认Client

Spring Cloud替换Feign默认Client

使用HTTP Client替换Feign默认Client 依赖配置 <!-- Spring Cloud OpenFeign的Starter的依赖 --> <dependency> <groupId>org.springframework.cloud<

Joe.Ye Joe.Ye 2023-03-26
0 0 0
Spring Boot小技巧总结

Spring Boot小技巧总结

Feign客户端直接指定IP调用服务 @FeignClient(value = "appblog-provider-channel-core", url="192.168.1.10:8888") public interface ChannelPayApi e

Joe.Ye Joe.Ye 2023-03-25
0 0 0
@FeignClient同一个name使用多个配置类的解决方案

@FeignClient同一个name使用多个配置类的解决方案

Feign有一个局限性,即对于同一个service-id只能使用一个配置类,如果有多个@FeignClient注解使用了相同的name或value属性,则注解的configuration参数会被覆盖。至于谁覆盖谁要看Spring容器初始化Bean的顺序。 注:@FeignClient同名覆盖需要配

Joe.Ye Joe.Ye 2023-03-25
0 0 0
Spring Cloud手动实例化Feign代码

Spring Cloud手动实例化Feign代码

Feign抽象化HTTP调用,可以以接口的形式调用远程服务,在实际开发中可以避免很多低级错误,比如误传、传错字段,统一响应避免乱适配等等。然而有时候在一些特殊的场景,比如: 1、当和consul结合使用时,出现异构调用,此时异构服务无法注册到consul导致调用失败 2、同一套服务,提供方多个,需根

Joe.Ye Joe.Ye 2023-03-11
0 0 0
Spring Cloud手动创建Feign客户端后zipkin调用链断层问题解决

Spring Cloud手动创建Feign客户端后zipkin调用链断层问题解决

Spring Cloud下通过手动创建Feign客户端进行服务间调用,导致zipkin调用链被截断,traceId不能延续导致调用链断层 解决方案:为Feign.Builder添加请求拦截器,加入请求头X-B3-TraceId和X-B3-SpanId,值为traceIdString和spanIdSt

Joe.Ye Joe.Ye 2023-03-11
0 0 0
Spring Cloud Feign请求拦截器和日志

Spring Cloud Feign请求拦截器和日志

Feign 支持请求拦截器,在发送请求前,可以对发送的模板进行操作,例如设置请求头等属性,自定请求拦截器需要实现 feign.RequestInterceptor 接口,该接口的方法 apply 有参数 template ,该参数类型为 RequestTemplate,我们可以根据实际情况对请求信息

Joe.Ye Joe.Ye 2023-03-11
0 0 0
Spring Cloud Feign传递map对象和多媒体文件

Spring Cloud Feign传递map对象和多媒体文件

Feign基本使用 Spring Cloud 通过Feign调用其他微服务的api具体用法 @EnableFeignClients //开启fegin客户端 @SpringBootApplication public class MongodbApiApplication {    publics

Joe.Ye Joe.Ye 2023-03-11
0 0 0
Spring Cloud手动定义Feign客户端

Spring Cloud手动定义Feign客户端

手动定义Feign客户端,可以灵活设置需要调用的服务 基本实现 @RestController @Import(FeignClientsConfiguration.class) public class AppblogService implements IAppblogService {

Joe.Ye Joe.Ye 2023-03-11
0 0 0
Spring Cloud Feign报错’xx.FeignClientSpecification’, defined in null, could not be registered

Spring Cloud Feign报错’xx.FeignClientSpecification’, defined in null, could not be registered

错误描述 版本使用的是: SpringBoot: 2.1.3.RELEASE SpringCloud: Greenwich.SR1 OpenFeign: 2.1.0.M2 报错: The bean 'xxxx.FeignClientSpecification', defin

Joe.Ye Joe.Ye 2023-03-11
0 0 0