spring-cloud-feign

Array Multipart[] file upload using Feign client

六月ゝ 毕业季﹏ 提交于 2019-12-12 21:08:03
问题 I am trying to upload Array of Multipart file object using feign client. This is the service am trying to call using Feign client. public ResponseEntity<Object> manageFileUpload(@RequestParam("files") MultipartFile[] files) I tried using,Feign client Annotation, @FeignClient(value = "UPLOADUTILITIES", configuration = Upload.MultipartSupportConfig.class, fallback = UploadFallback.class) My Method, @RequestMapping(name = "upload", value = "/object", method = RequestMethod.POST) @Headers(

@EnableFeignClients and @FeignClient fail on Autowiring 'FeignContext' NoSuchBeanException

只谈情不闲聊 提交于 2019-12-12 08:28:28
问题 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 @Autowired ReviewProvider : Exception (cause) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.netflix.feign.FeignContext' available at org.springframework.beans

where does the maven version get overridden?

久未见 提交于 2019-12-11 18:25:06
问题 I am building a spring boot starter, following the recommended convention with core / autoconfigure / starter module separation. When I look at the maven dependency-tree, this is what I have : [INFO] com.myDomain.myProject:myProject-starter:jar:1.0.8-SNAPSHOT [INFO] +- com.myDomain.myProject:myProject-autoconfigure:jar:1.0.8-SNAPSHOT:compile [INFO] | \- com.myDomain.myProject:myProject-core:jar:1.0.8-SNAPSHOT:compile [INFO] | +- io.github.openfeign:feign-gson:jar:9.5.1:compile [INFO] | | +-

How to properly emulate FeignClient responses in JUnit tests

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 15:53:57
问题 I am using FeignClient for communication between microservices. I would like to test one microservice without running the other, so I need somehow to emulate responses from it. At this time I am mocking feignClient. However is it a right way for emulating FeignClient's responses in this situation? My FeignClient: @FeignClient(name="shortestPath", url="http://localhost:5000") public interface GraphFeignClient { @PostMapping(path="/short") public List<Integer> getShortestPath(@RequestParam(

Feign Client - Dynamic Authorization Header

你。 提交于 2019-12-11 12:49:19
问题 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 same authorization header. Currently I use a Filter to extract the authorization header from the incoming request, store the header in a ThreadLocal. When building the Feign Client I use a RequestInterceptor to read the authorization header from the ThreadLocal and put it into the request to

How to disable eureka lookup on specific @FeignClient

倾然丶 夕夏残阳落幕 提交于 2019-12-10 09:32:47
问题 I have a microservice that uses @FeignClient predominantly to talk to other micro-services. This works beautifuly using Eureka's service discovery mechanism. Now I have a pressing need to use a @FeignClient to connect to an external system and still perform load balancing using configurations as shown below. Feign client : @FeignClient("externalServers") public interface ExternalServersClient { @RequestMapping(method = RequestMethod.GET, value = "/someExternalUrl") ResponseEntity<Object>

How to fine-tune the Spring Cloud Feign client?

回眸只為那壹抹淺笑 提交于 2019-12-09 13:19:12
问题 The Spring Cloud doc says: If Hystrix is on the classpath, by default Feign will wrap all methods with a circuit breaker. That's good but how do I configure the Hystrix options to ignore certain exceptions? I've an ErrorDecoder implementation that maps HTTP status code to exceptions. If I put @HystrixCommand on the method, does Feign honor that? Our requirement is to log various details about every HTTP call made out to dependencies. Currently I've a decorated RestTemplate that does this.

How can I change the feign URL during the runtime?

本小妞迷上赌 提交于 2019-12-09 06:27:17
问题 @FeignClient(name = "test", url="http://xxxx") How can I change the feign URL (url="http://xxxx") during the runtime? because the URL can only be determined at run time. 回答1: Feign has a way to provide the dynamic URLs and endpoints at runtime. The following steps have to be followed: In the FeignClient interface we have to remove the URL parameter. We have to use @RequestLine annotation to mention the REST method (GET, PUT, POST, etc.): @FeignClient(name="customerProfileAdapter") public

How to generate spring cloud feign client using swagger-codegen-maven-plugin

可紊 提交于 2019-12-07 20:23:47
问题 I want to generate my feign client code using swagger-codegen, but I cannot find the docs which can lead me to do it. I have a microservice using spring cloud, several api-services using spring-cloud-feign interfaces to request the data.I wish that i can generate the feign client code. <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>2.2.3</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec

Spring AOP not working for Feign Client

风流意气都作罢 提交于 2019-12-07 16:19:47
问题 I having an aop-setup @Target({ElementType.METHOD}) @Retention(value = RetentionPolicy.RUNTIME) public @interface IgnoreHttpClientErrorExceptions { } @Aspect @Component public class IgnoreHttpWebExceptionsAspect { @Around(value = "@annotation(annotation)", argNames = "joinPoint, annotation") public Object ignoreHttpClientErrorExceptions(ProceedingJoinPoint joinPoint, IgnoreHttpClientErrorExceptions annotation) throws Throwable { try { //do something } catch (HttpClientErrorException ex) { /