Feign is a java to http client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. Feign's first goal was reducing the complexity of binding Denominator uniformly to http apis regardless of restfulness.
Questions tagged [feign]
493 questions
34
votes
6 answers
Feign logging not working
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();
…
![](../../users/profiles/265119.webp)
Magick
- 3,281
- 14
- 54
- 82
27
votes
6 answers
How to write integration tests with spring-cloud-netflix and feign
I use Spring-Cloud-Netflix for communication between micro services. Let's say I have two services, Foo and Bar, and Foo consumes one of Bar's REST endpoints. I use an interface annotated with @FeignClient:
@FeignClient
public interface BarClient {
…
![](../../users/profiles/820666.webp)
Bastian Voigt
- 4,617
- 5
- 34
- 61
26
votes
6 answers
Netflix Feign - Propagate Status and Exception through Microservices
I'm using Netflix Feign to call to one operation of a Microservice A to other other operation of a Microservice B which validates a code using Spring Boot.
The operation of Microservice B throws an exception in case of the validation has been bad.…
![](../../users/profiles/4751165.webp)
Pau
- 11,098
- 10
- 54
- 83
18
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}",…
![](../../users/profiles/1688441.webp)
Menelaos
- 20,773
- 14
- 71
- 130
16
votes
1 answer
How to add a request interceptor to a feign client?
I want every time when I make a request through feign client, to set a specific header with my authenticated user.
This is my filter from which I get the authentication and set it to the spring security…
![](../../users/profiles/6287214.webp)
Gustavo
- 2,683
- 7
- 22
- 36
16
votes
3 answers
Can I throw a custom error if a hystrix-protected call times out?
I have a feign client with this external call:
@RequestMapping(method = RequestMethod.GET, value = "GetResourceA", consumes = "application/json")
@Cacheable("ResourceA")
List getResourceA() throws MyOwnException;
And in my application.yml I…
![](../../users/profiles/1539208.webp)
L42
- 2,454
- 3
- 24
- 39
14
votes
3 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?
![](../../users/profiles/49881.webp)
Newbie
- 6,097
- 9
- 53
- 77
12
votes
3 answers
Body parameters cannot be used with form parameters - Feign client with Headers and json data
I have a FeignClient like this
@RequestLine("POST /enroll")
@Headers({ "header1: {header1}", "header2: {header2}", "Content-Type: application/json" })
ResponseDto enroll(@Param("header1") String header1,@Param("header1") String header1, RequestDto…
![](../../users/profiles/4552718.webp)
Seetharamani Tmr
- 770
- 1
- 6
- 24
12
votes
2 answers
How to call url with multiple query string params in FeignClient?
I try to call Google API with multiple query string parameters. And curiously, I can't find a way to do that.
This is my FeignClient :
@FeignClient(name="googleMatrix", url="https://maps.googleapis.com/maps/api/distancematrix/json")
public…
![](../../users/profiles/1786819.webp)
jeremieca
- 1,026
- 1
- 12
- 33
11
votes
5 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…
![](../../users/profiles/246807.webp)
hudsonmendes
- 449
- 1
- 6
- 17
10
votes
1 answer
How to send Bearer authorization token using Spring Boot and @FeignClient
I am using Spring Boot to write an application that interacts with HTTP rest servers. One of the servers I'm connecting to (Wit.ai) uses a beaerer authorization token. A curl request that yields a successful response looks like this:
GET…
![](../../users/profiles/9593131.webp)
Trey Bernstien
- 103
- 1
- 1
- 7
10
votes
2 answers
How to set custom Jackson ObjectMapper with Spring Cloud Netflix Feign
I'm running into a scenario where I need to define a one-off @FeignClient for a third party API. In this client I'd like to use a custom Jackson ObjectMapper that differs from my @Primary one. I know it is possible to override spring's feign…
![](../../users/profiles/49881.webp)
Newbie
- 6,097
- 9
- 53
- 77
9
votes
4 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…
![](../../users/profiles/3607698.webp)
kcoder
- 1,701
- 2
- 18
- 39
9
votes
1 answer
Feign client Retryer with a new request interceptor?
I am currently building a feign client manually and passing Interceptors to it for authorization. I would like to have a smarter Retryer for some Response code.
public class myErrorEncoder extends ErrorDecoder.Default {
@Override
public Exception…
![](../../users/profiles/4125630.webp)
Mik jagger
- 1,988
- 2
- 10
- 17
9
votes
2 answers
How to set custom Feign client connection timeout?
I have Spring Boot application with this Gradle…
![](../../users/profiles/2893903.webp)
Roman Cherepanov
- 1,440
- 1
- 20
- 38