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.

635 questions
4
votes
1 answer

Fallback Factory not working to handle Custom Exception in Feign Client

My requirement is to access the custom exception thrown from first service along with it's body content in the second service I have tried 2 things so far, FallbackFactory and ErrorDecoder, out of which only Fallback factory worked for me. Error…
Akki
  • 754
  • 7
  • 22
4
votes
1 answer

Spring Boot OpenFeign: java.lang.IllegalStateException: Method has too many Body parameters

The examples below demonstrate the issues experienced when using OpenFeign. The problem becomes evident when your response object has too many fields, which throws an error: Method has too many parameters. Example 1 works perfectly, but Example 2…
S34N
  • 7,469
  • 6
  • 34
  • 43
4
votes
3 answers

Feign client support for optional request param

Does Feign client support optional request param? For example, I have an endpoint, but I am not finding a way to actually make the param1 optional using feign client. @GetMapping(path = "endpoint1") ResponseEntity request(@RequestParam(name =…
krmanish007
  • 6,749
  • 16
  • 58
  • 100
4
votes
1 answer

Bypass the global list of RequestInterceptors for one FeignClient

Within our microservices, we use Feign to communicate between services, we have a dedicated RequestInterceptor to handle the security and attach our JWT token to each request. I would like to use Feign for calls to a 3rd party service outside my…
Anthony Richir
  • 649
  • 2
  • 8
  • 31
4
votes
5 answers

Spring AOP does not intercept Feign.Client calls

I'm trying to use Spring AOP to intercept Feign.Client calls and log request and response to my Splunk Server. All methods in my project package are intercepted as I expected but Feign.Client doesn't. This is my AOP class: @Component @Aspect public…
Ronaldo Lanhellas
  • 2,975
  • 5
  • 46
  • 92
4
votes
2 answers

How to disable hystrix in one of multiple feign clients

In my spring boot application I use multiple feign clients (@FeignClient("hello-service")). In the case of many of them, I need a mechanism of circuit breaker, so I have following line to the configuration. feign.hystrix.enabled=true However I'don't…
xiliann
  • 41
  • 2
4
votes
3 answers

Feign and undeclared throwable exception for 404 Not Found

I'm trying to catch Feign response and evaluate exception for 404 Not Found response something like REST Template does below: try { response = restTemplate.exchange(url, HttpMethod.GET, request, Foo.class); } catch (HttpClientErrorException ex)…
JackTheKnife
  • 3,795
  • 8
  • 57
  • 117
4
votes
2 answers

Spring Feign client call enters exception block when it should stay in try block

Need some small help about Spring Feign client. So here is the situation, I have 2 Spring boot services. Let’s say Service A and Service B. I have configured my Service A with Feign client through which I call the Service B method. So here is the…
WebNoob
  • 237
  • 6
  • 16
4
votes
3 answers

Feign Client Dynamic Authorization Header

I have a service that gets http request with an authorization header. When processing the request, I want to use a Feign Client to query another service. The query to the other service should include the different authorization header.
4
votes
1 answer

How to stop feign from qouting and escaping string data

I have a proxy that sits in between a client and a server that are communicating using json objects. The proxy needs to handle the data as a string. It has no knowledge of the types it simply needs to scan the data for strings. The problem is when I…
Jeff Gaer
  • 351
  • 3
  • 21
4
votes
1 answer

Kotlin data class Jackson @JsonProperty not honored

I'm wiring up Feign to POST using a Kotlin data class. The API I'm calling expects {..."brandInfo":{"TPID":1}...} My understanding is, if the jackson-module-kotlin dependency wasn't being picked up correctly, Feign wouldn't be able to POST at all,…
fred
  • 1,812
  • 3
  • 37
  • 57
4
votes
1 answer

how to generate URI parameter for dynamic feign basePath using swagger codegen?

I have a pretty simple question :) According to feign documents, they are supporting in changing the basePath of a feign client object dynamically by passing URI parameter trough the api function like so: GOOD Example: interface MyClient { …
dorony
  • 1,008
  • 1
  • 14
  • 31
4
votes
2 answers

Spring cloud netflix and HystrixObservable --> JsonMappingException

For code, see my tiny 4 class github project I am using Spring FeignClients to connect to a rest service. This is what the Feign client looks like in its basic (non-async) form: @FeignClient(value="localhost:8080/products", decode404 = true) public…
Anne van Leyden
  • 139
  • 1
  • 9
4
votes
2 answers

Can I dynamic create a Feign Client or create an instance with a different name

I've defined an REST interface that has a different Spring Boot Application implementation using different spring.application.name (spring.application.name can not be the same in my business). How can I only define a Feign Client, and can access all…
4
votes
1 answer

Feign Hystrix command name not working

If I just have a Hystrix Command defined as class, i have control over defining the group key and command key like below. private static class MyHystrixCommand extends HystrixCommand { public MyHystrixCommand() { …
Seetha
  • 980
  • 1
  • 8
  • 27