netflix-feign

Spring Cloud: How to use Feign without Ribbon

。_饼干妹妹 提交于 2021-02-05 20:22:13
问题 I would like to use Feign without client-side loadbalancer Ribbon because I don't want to run Eureka, which would need to be distributed and highly available. Instead internal ELBs with internal DNS names managed by Route53 will do just fine. Providing plain URLs to @FeignClient always results in no loadbalancer found for .. , so I tried preventing Feign from using Ribbon: Spring Cloud Netflix comes with FeignRibbonClient , which is used if ILoadBalancer from ribbon-loadbalancer is present.

Spring Cloud: How to use Feign without Ribbon

与世无争的帅哥 提交于 2021-02-05 20:21:24
问题 I would like to use Feign without client-side loadbalancer Ribbon because I don't want to run Eureka, which would need to be distributed and highly available. Instead internal ELBs with internal DNS names managed by Route53 will do just fine. Providing plain URLs to @FeignClient always results in no loadbalancer found for .. , so I tried preventing Feign from using Ribbon: Spring Cloud Netflix comes with FeignRibbonClient , which is used if ILoadBalancer from ribbon-loadbalancer is present.

Spring Cloud Feign Client @RequestParam with List parameter creates a wrong request

[亡魂溺海] 提交于 2021-01-02 06:06:29
问题 I have a Spring Clound Feign Client mapping defined as following @RequestMapping(method = RequestMethod.GET, value = "/search/findByIdIn") Resources<MyClass> get(@RequestParam("ids") List<Long> ids); when I call feignClient.get(Arrays.asList(1L,2L,3L)) according to what I can see in the debugger, the feign-core library forms the following request: /search/findByIdIn?ids=1&ids=2&ids=3 instead of expected /search/findByIdIn?ids=1,2,3 which would be correct for the server Spring Data REST

Could not use POST method with Feign

时光总嘲笑我的痴心妄想 提交于 2020-12-03 04:19:06
问题 im trying to write wrapper for stockfigher game api, just to learn how feign works and I have issues with very first POST method: @RequestMapping(method = RequestMethod.POST, value = "/venues/KHEX/stocks/LMC/orders") void newOrderForAStock(String order); whenever I try to call it, I get exception: Caused by: feign.RetryableException: cannot retry due to redirection, in streaming mode executing POST https://api.stockfighter.io/ob/api//venues/KHEX/stocks/LMC/orders at feign.FeignException

Could not use POST method with Feign

浪尽此生 提交于 2020-12-03 04:15:51
问题 im trying to write wrapper for stockfigher game api, just to learn how feign works and I have issues with very first POST method: @RequestMapping(method = RequestMethod.POST, value = "/venues/KHEX/stocks/LMC/orders") void newOrderForAStock(String order); whenever I try to call it, I get exception: Caused by: feign.RetryableException: cannot retry due to redirection, in streaming mode executing POST https://api.stockfighter.io/ob/api//venues/KHEX/stocks/LMC/orders at feign.FeignException

Feign Client does not resolve Query parameter

自闭症网瘾萝莉.ら 提交于 2020-08-06 20:39:07
问题 Here is my interface. public interface SCIMServiceStub { @RequestLine("GET /Users/{id}") SCIMUser getUser(@Param("id") String id); @RequestLine("GET /Groups?filter=displayName+Eq+{roleName}") SCIMGroup isValidRole(@Param("roleName") String roleName); } Here getUser call works fine. But isValidRole is not working properly as the request is eventually sent like this. /Groups?filter=displayName+Eq+{roleName}" Here {roleName} is not resolved. What am I missing here? Appreciate some help, as I'm

Define different Feign client implementations based on environment

 ̄綄美尐妖づ 提交于 2020-03-18 06:22:48
问题 I have a Spring boot application which uses Feign to call an external web service via Eureka. I'd like to be able to run the application using a mocked out implementation of the Feign interface, so I can run the application locally without necessarily having Eureka or the external web service running. I had imagined defining a run configuration that allowed me to do this, but am struggling to get this working. The issue is that the Spring "magic" is defining a bean for the Feign interface no

Feign/Eureka client not passing X-Forwarded-For header

守給你的承諾、 提交于 2020-02-26 10:17:25
问题 I use Spring boot + Eureka + Feign client to forward requests from one discovered server to another and it works fine. In my server I need to get the IP of the original user. I can't seem to find how to configure Feign client to automatically edit the 'X-Forwarded-For' header so I could be able to extract the original user's IP address. When I use getRemoteAddr() I get the proxy IP address (As expected). When Trying to extract the request.getHeader("X-Forwarded-For") I always get null. Where

Feign/Eureka client not passing X-Forwarded-For header

*爱你&永不变心* 提交于 2020-02-26 10:16:49
问题 I use Spring boot + Eureka + Feign client to forward requests from one discovered server to another and it works fine. In my server I need to get the IP of the original user. I can't seem to find how to configure Feign client to automatically edit the 'X-Forwarded-For' header so I could be able to extract the original user's IP address. When I use getRemoteAddr() I get the proxy IP address (As expected). When Trying to extract the request.getHeader("X-Forwarded-For") I always get null. Where

spring boot application failed to autowired feign client

谁说我不能喝 提交于 2020-02-04 02:29:29
问题 created a sample project of spring boot application to understand the feign client functionality, when run it gives below error. Description: Field remoteCallClient in com.example.demo.RestClient required a bean of type 'com.example.demo.RemoteCallClient' that could not be found. Action: Consider defining a bean of type 'com.example.demo.RemoteCallClient' in your configuration. I tried various ways but it could not resolved, provided entire source code of sample project. POM.xml <?xml version