Questions tagged [openfeign]

237 questions
5
votes
1 answer

Replace org.springframework.cloud.openfeign.ribbon.CachingSpringLoadBalancerFactory

When I upgrade implementation 'org.springframework.cloud:spring-cloud-openfeign-core:2.2.2.RELEASE' to latest version implementation 'org.springframework.cloud:spring-cloud-openfeign-core:3.1.1' I get error for this imported class: import…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
5
votes
1 answer

How to make multiple FeignClient-s to use same serviceId/name?

assume 2 endpoints: @RequestMapping("/ep1") interface Endpoint1 { @GetMapping("/echo") String echo(); } @RequestMapping("/ep2") interface Endpoint2 { @GetMapping("/echo") String echo(); } On backend side are both running in same…
mirec
  • 627
  • 1
  • 8
  • 23
5
votes
3 answers

How to inject custom Http client to Spring Cloud openfeign?

I'm trying to provide CloseableHttpClient to Spring Cloud OpenFeign. Spring Cloud Open Feign Documentationsays it supports CloeableHttpClient. Spring documentation doesn't give any example of actually replacing the HTTP client. Basically, I'm…
Akshay Hiremath
  • 950
  • 2
  • 12
  • 34
5
votes
1 answer

Mocking an OpenFeign client for Unit Testing in a spring library and NOT for a spring boot application

I've implemented a feign client that calls a get API based on this official repository. I have a rule class UserValidationRule that needs to call that get API call getUser() and validate some stuff. That works as expected but when I get to testing…
Dendin
  • 163
  • 1
  • 6
  • 19
5
votes
1 answer

Using Feign builder requests doesn't send trace-id, span-id to child clients but using rest template is showing all headers on child clients

I'm making a sequential request using Feign Builder. There are no x-b3-traceid,x-b3-spanid .. in the title of the request. That's why the log my last client appears on the zipkin. I use spring boot 2.4.2 , spring cloud 2020.0.0 , feign-core 10.10.1…
5
votes
0 answers

Content type header value resulting in UnsupportedMediaType 415 OpenFeign

We recently upgraded to spring-cloud-starter-openfeign: 2.2.2 from version 2.0.0 and we encountered the following exception when calling the REST API that uses consumes and also having @RequestHeader Content-Type: …
Yuval Simhon
  • 1,439
  • 2
  • 19
  • 34
5
votes
2 answers

Spring Boot OpenFeign random port test

I have an OpenFeign client set up like this: @FeignClient(name = "myService", qualifier = "myServiceClient", url = "${myservice.url}") public interface MyServiceClient { ... } and a Spring Boot test set up like this: @SpringBootTest(webEnvironment…
Lukasz G.
  • 119
  • 1
  • 10
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
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

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
2 answers

Spring + OpenFeign: POST Results in NoSuchBeanDefinitionException

I've been struggling with this for a while now. In short, the problem is whenever I make a POST request using OpenFeign I get the following error: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type…
mneri
  • 2,127
  • 2
  • 23
  • 34
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
4 answers

Is there a way to record response times of feign client

@FeignClient(...) public interface SomeClient { @RequestMapping(value = "/someUrl", method = POST, consumes = "application/json") ResponseEntity createItem(...); } Is there a way to find the response times for createItem api call? We…
4
votes
1 answer

Error sending MultipartFile to REST API using Spring Boot and Open feign

I'm trying to attach a file to send to and endpoint as a MultipartFile but I'm getting this exception: Expected no exception to be thrown, but got 'feign.codec.EncodeException' //... Caused by: feign.codec.EncodeException: Could not write request:…
Javier C.
  • 7,859
  • 5
  • 41
  • 53
3
votes
1 answer

Getting "Only Single Level Inheritance Supported" Error with SpringBoot Eureka Feign Client

I am working through a tutorial creating a eureka server and eureka client. Prior to adding the feign client, the eureka client is able to register with the eureka server. After I added the feign maven dependency and created the annotations in the…
Othello
  • 55
  • 11
1
2
3
15 16