Questions tagged [openfeign]

237 questions
2
votes
1 answer

Donot wrap exceptions of Feign client Fall back method with Hystrix RunTime Exception

Fallback service is wrapping ProductNotFoundException into HystrixRunTimeException. I want to propagate custom exception as it is instead of wrapping into HystrixRunTimeException. Below is the code snippet for reference: @FeignClient(name =…
2
votes
1 answer

I have to call a microservice from a batch launched from another microservice using spring-batch and openfeign

I don't know if it's possible, but this is my question: I hava a batch developed using spring-boot and spring-batch, and I have to call another microservice using Feign... ...help! this is my class Reader package it.batch.step; import…
2
votes
0 answers

Not receiving body when a request returns a error - Spring Boot Feign Client

Techs: One module with Spring Boot 2.1.7 (starter web, openfeign) Api Gateway With Spring Boot 2.1.3 I wanna capture the error from the feign client to send again on my error message. But when I debug the response it shows nothing on the body.…
Victor Henrique
  • 327
  • 1
  • 5
  • 16
2
votes
1 answer

Feign for downloading file

I am trying to find a simple way to use Feign to download a csv file (retaining the filename). What is the easiest and cleanest way? The multipart solution on the feign-form github page is verbose and isn't working for me. Any help is appreciated.
user12722869
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

config values are null in the OpenFeign controller

Hi I am new to openfeign, I am trying to use a controller class that builds fein clients, and would like to use the exertenalised 'baseurl' from config file, but its not reading it from the config file, it reads it in other parts of the project, in…
tinkerbell
  • 23
  • 5
2
votes
0 answers

Why there is no @FeignClient annotation in feign client template in OpenApi

Straight to the point -> anybody knows why this template file does not have @FeignClient annotation? Problem is we would like to use @EnableFeignClients annotation in our configuration, but seems like without @FeignClient anootations in generated…
Piotr Tempes
  • 1,091
  • 1
  • 12
  • 26
1
vote
0 answers

Microservice Communication for Graphql APIs

Problem Statement : I have a GraphQl query defined which is responsible for fetching few details from the database. This graphql schema let's say is defined in microservice-B . Now I want this garphql API to be called by an upstream…
1
vote
0 answers

feign.FeignException$BadRequest: [400 Bad Request] during [GET] to [http://cameraservice/api/cameras?id.in=11&id.in=12&

I need to get a response from another service, I do it FeignClient, when more than 100 ids are passed in the request parameters, this error appears. If less than 100 it works fine. my FeignClient: @FeignClient( name =…
1
vote
0 answers

How to reject requests with the request XML in Feign Client

I am using feign version 12.1, Open Feign 3.8.0 to send (POST) requests. It works fine. But the problem is sometimes the user sends XML body messages which shouldn't be.User should always send JSON type messages in the request body and the other…
Tonyukuk
  • 5,745
  • 7
  • 35
  • 63
1
vote
3 answers

Feign Client with Spring Cloud GatewayFilter cause cycle dependency

During certain checks, I need to make a request to my Microservice in the Gateway Filter. When I define the Feign class in the GatewayFilter(my SecurityFilter.java) class, it gives the following error. How can I resolve this…
1
vote
1 answer

Feign: How to extract a header value in the response of a post?

I have the following problem I'm trying to solve using Feign: I do a POST call to a service. I then need to extract a value out of the response header (a correlation id) that I need to save in a database. The only way I found to do this was by…
Nos
  • 1,024
  • 1
  • 8
  • 14
1
vote
4 answers

OpenFeign request throws AbstractMethodError

Request: @Headers("userId: {userId}") @RequestMapping(method = RequestMethod.GET, value = "/token") String getToken(@RequestHeader(name = "userId") Long userId); Handler: @GetMapping("/token") public ResponseEntity
dev-rifaii
  • 217
  • 2
  • 9
1
vote
2 answers

Should Feign interface has @PathVariable and @RequestParam annotations with stated names to work?

In fresh openfeign library (version 3.1.3) there is a check in PathVariableParameterProcessor, that verifies, that arguments with @PathVariable annotation should have name attribute filled. Similar check exists in RequestParamParameterProcessor. In…
WeGa
  • 801
  • 4
  • 10
  • 24
1
vote
0 answers

Fetch Token from Kafka Message and Inject it to all feign calls

I have a scenario. My Microservice A is sending Kafka Message to ServiceB. Service B is consuming that message and after processing it is Sending update request to Service C. I am sending Oauth token from Service A to Service B in kafka message…
1
vote
0 answers

open feign does not recognize static headers

I have tried dynamic headers sending them as HashMap like this: Map headers = new HashMap<>(); headers.put("x-country", "CL"); and all works fine, but I need to send them as static headers, and I am doing it this…