Questions tagged [spring-cloud-feign]

Use this tag for question related to the use of Feign declarative REST client inside the spring cloud ecosystem.

Feign declarative REST client used inside the spring cloud ecosystem.

734 questions
56
votes
10 answers

How can I change the feign URL during the runtime?

@FeignClient(name = "test", url="http://xxxx") How can I change the feign URL (url="http://xxxx") during the runtime? because the URL can only be determined at run time.
liucyu
  • 571
  • 1
  • 4
  • 3
54
votes
7 answers

What are the advantages and disadvantages of using feign over RestTemplate

I get that Feign is declarative and hence it abstracts out a lot of things for the developer. But, when should one choose one over the other? Though feign is declarative, it has serious problems with oAuth. What are some of the considerations in…
codingsplash
  • 4,785
  • 12
  • 51
  • 90
42
votes
9 answers

Feign logging not working when alter level

I'm trying to get logging working for each request from a Feign rest client. However I cannot get the logging to work, while 'standard' Slf4j logging does work. I have the following: public MyClient() { initConnectionProperties(); …
Magick
  • 4,603
  • 22
  • 66
  • 103
34
votes
4 answers

Feign Client with Spring Boot: RequestParam.value() was empty on parameter 0

I created a simple Feign Client with Spring Boot like this: @FeignClient("spring-cloud-eureka-client") public interface GreetingClient { @RequestMapping("/greeting") String greeting(@RequestParam String name); } But when I try just to start…
Igorock
  • 2,691
  • 6
  • 28
  • 39
29
votes
8 answers

How to get bearer token from header of a request in java spring boot?

Hi what trying to achieve is to get bearer token that submited from front end in java spring boot RESTApi controller and do another request using feign client to another microservices? here is what i do image above is how i do my request from…
Ke Vin
  • 3,478
  • 11
  • 60
  • 91
28
votes
9 answers

How to POST form-url-encoded data with Spring Cloud Feign

Using spring-mvc annotations: How can I define an @FeignClient that can POST form-url-encoded?
Newbie
  • 7,031
  • 9
  • 60
  • 85
26
votes
6 answers

spring feign client exception handling

I have some fiegn client to send request other micro service. @FeignClient(name="userservice") public interface UserClient { @RequestMapping( method= RequestMethod.GET, path = "/userlist" ) String…
scoder
  • 2,451
  • 4
  • 30
  • 70
22
votes
7 answers

Feign ErrorDecoder : retrieve the original message

I use a ErrorDecoder to return the right exception rather than a 500 status code. Is there a way to retrieve the original message inside the decoder. I can see that it is inside the FeignException, but not in the decode method. All I have is the…
kaizokun
  • 926
  • 3
  • 9
  • 31
20
votes
2 answers

Differences between netflix.feign & openfeign

Introduction I recently used netflix feign along with ribbon which was quite useful. An Example of this is: @FeignClient(name = "ldap-proxy") public interface LdapProxyClient { @RequestMapping(path = "/ldap-proxy/v1/users/{userNameOrEMail}",…
Menelaos
  • 23,508
  • 18
  • 90
  • 155
19
votes
3 answers

Feign and Spring Security 5 - Client Credentials

I am trying to invoke some backend system which is secured by a client_credentials grant type from a Feign client application. The access token from the backend system can be retrieved with the following curl structure (just as an example): curl…
Ralf
  • 453
  • 1
  • 4
  • 15
19
votes
2 answers

Spring Cloud Feign: Is Feign efficient enough compared with RestTemplate?

I quickly browsed the source code of Feign, I found that Feign uses JDK's HttpUrlConnection to issue HTTP request and close it when request finished without using a connection pool. I doubt the efficiency of this kind of manner. Then I read the…
Neo
  • 2,196
  • 5
  • 32
  • 58
17
votes
2 answers

springboot could not found feignclient

ERROR INFO LIKE BELOW: *************************** APPLICATION FAILED TO START *************************** Description: Field helloAgent in com.example.client.controller.Hello required a bean of type 'com.example.common.agent.HelloAgent' that…
ajianzheng
  • 283
  • 2
  • 3
  • 11
17
votes
1 answer

Spring Cloud Feign Non blocking I/O or Asynchronous Call

I am developing microservices using Spring cloud platform where service1 calls multiple other micro services e.g. service2, service3, service 4 etc. These services can be called in parallel and service1 will aggregate the result. Can I use Spring…
Debopam
  • 3,198
  • 6
  • 41
  • 72
16
votes
7 answers

Feign client and Spring retry

I have a restful service calling an external service using Spring Cloud Feign client @FeignClient(name = "external-service", configuration = FeignClientConfig.class) public interface ServiceClient { @RequestMapping(value = "/test/payments",…
16
votes
6 answers

@EnableFeignClients and @FeignClient fail on Autowiring 'FeignContext' NoSuchBeanException

The microservice I'm writting needs to communicate to other microservices in our platform. On that attempt, the ideal solution for us is Spring Cloud Netflix Feign, implemeting a @FeignClient. However, I'm facing the exception below when I try an…
1
2 3
48 49