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
5
votes
1 answer

Spring Data Pageable not supported as RequestParam in Feign Client

I have been trying to expose a Feign Client for my rest api. It takes Pageable as input and has PageDefaults defined. Controller: @GetMapping(value = "data", produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation(value = "Get Data", nickname =…
Crickcoder
  • 2,135
  • 4
  • 22
  • 36
5
votes
1 answer

how can I get the current Bearer token of my request?

I am trying to do something relatively simple. I have a request that receives an oauth token (Bearer asdf22324...) I need it to pass it to my feign client to be able to request another service using the same token. Is it possible to do that? Any…
jpganz18
  • 5,508
  • 17
  • 66
  • 115
5
votes
3 answers

Spring Cloud Feign + Sleuth + Zipkin - original request is required

I have multiservices application which is using Spring Cloud OpenFeign. Now I have to use zipkin with that app. I remember that when i had app without Feign I just added Sleuth and Zipkin starters dependencies and run zipkin server on port 9411.…
ilovespring
  • 73
  • 1
  • 4
5
votes
5 answers

FeignClient converts GET method to POST

I don't know what I'm doing wrong, but each time feign client converts method declared as get to post type. @FeignClient(name = "my-service", url = "http://localhost:8114", path = "service") public interface MyServiceClient { …
Kamil W
  • 2,230
  • 2
  • 21
  • 43
5
votes
4 answers

How to define global static header on Spring Boot Feign Client

I have a spring boot app and want to create a Feign client which has a statically defined header value (for auth, but not basic auth). I found the @Headers annotation but it doesn't seem to work in the realm of Spring Boot. My suspicion is this…
Stimp
  • 567
  • 1
  • 7
  • 11
5
votes
3 answers

Configure Proxy Route Planner on Spring-Cloud-Feign

Configure Proxy Route Planner on Feign I need to know how to make requests being behind a proxy server using the spring boot REST client. I can do this configuration using apache commons for REST requests like this: Method that performs POST: Map…
5
votes
7 answers

Spring Feign: Could not extract response: no suitable HttpMessageConverter found for response type

I am trying to get a Spring Cloud Netflix Feign client to fetch a bit of JSON over HTTP and convert it to an object. I keep getting this error instead: org.springframework.web.client.RestClientException: Could not extract response: no suitable…
urig
  • 16,016
  • 26
  • 115
  • 184
4
votes
1 answer

How to change the field name in a request body of feign client?

I have a feign client that uses a dto to perform the request using @RequestBody. The problem is that some property does not match with the java standards, for example id_client. Is there a way to change the variable name and keep it working with the…
4
votes
2 answers

Spring Cloud OpenFeign - How can I create a Test Slice?

I have a test for a Feign client and I would like to set up a test slice, like @WebMvcTest, @DataJpaTest, etc. For example, the following test uses @SpringBootTest and it loads all the application context: @SpringBootTest @AutoConfigureWireMock(port…
henriquels
  • 518
  • 4
  • 20
4
votes
0 answers

How to override global request interceptor for single feign client

I have global request interceptor @Bean public RequestInterceptor requestInterceptor() { return new OAuth2FeignRequestInterceptor(new DefaultOAuth2ClientContext(), resource()); } It should be applied to every feign client except…
Fal Alexandr
  • 149
  • 1
  • 10
4
votes
0 answers

Feign client method and java.lang.IllegalArgumentException: Body parameter 1 was null

I have the following Feign client method: @GetMapping RestPageImpl findAllCompanies(@RequestParam(value = "name", required = false) String name, Pageable pageable, @RequestHeader("Authorization") String token); everything works fine…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
4
votes
4 answers

Jackson with Feign can't deserialized Spring's org.springframework.data.domain.Sort

The problem: A feign client, making an API call to a Spring boot Rest API that returns a Page can't deserialize the sort property of that page. Spring Boot: 2.3.3.Release Spring Cloud Feign:…
Erik
  • 997
  • 4
  • 14
  • 24
4
votes
1 answer

How to get rid of stream is closed error with FeignErrorDecoder?

I have a feign client service built like this : Feign.Builder builder = Feign.builder() .contract(new SpringMvcContract()) .encoder(new JacksonEncoder()) .decoder(new JacksonDecoder()) .errorDecoder(new…
louis amoros
  • 2,418
  • 3
  • 19
  • 40
4
votes
2 answers

How to decode JSon response with custom Feign client?

In my application, I have to know, from a list a server addresses, which are up. The solution I found is to call health endpoint from Spring-Boot Actuator, for each of them. The JSon reponse is: { "status": "UP" } In other parts of the…
Ticker
  • 61
  • 1
  • 1
  • 3
4
votes
0 answers

How to upgrade java 8 SOAP call to java 11 SOAP call using feign

I'm moving from java 8 to java 11. I have integration with old style SOAP 1.2 service. Because of cutting of JEE web services stuff from java 11 extending from javax.xml.ws.Service and call super.getPort(new QName(...), SomeWebService.class,…
Piotr Żak
  • 2,083
  • 6
  • 29
  • 42