Questions tagged [feign]

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.

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(); …
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 { …
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.…
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}",…
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…
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…
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?
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…
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…
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…
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…
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…
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…
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…
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…
Roman Cherepanov
  • 1,440
  • 1
  • 20
  • 38
1
2 3
32 33