spring-cloud-netflix

Spring Cloud Feign Client @RequestParam with List parameter creates a wrong request

[亡魂溺海] 提交于 2021-01-02 06:06:29
问题 I have a Spring Clound Feign Client mapping defined as following @RequestMapping(method = RequestMethod.GET, value = "/search/findByIdIn") Resources<MyClass> get(@RequestParam("ids") List<Long> ids); when I call feignClient.get(Arrays.asList(1L,2L,3L)) according to what I can see in the debugger, the feign-core library forms the following request: /search/findByIdIn?ids=1&ids=2&ids=3 instead of expected /search/findByIdIn?ids=1,2,3 which would be correct for the server Spring Data REST

Spring cloud discovery first does not work at all

做~自己de王妃 提交于 2020-06-17 09:24:16
问题 I try to implement a spring cloud netflix project with a eureka service registry, a configuration server and a client microservice. I use spring cloud finchley release. I have two problems: 1. Eureka and configuration server are both running, but do not recognize each other. I have read the official docs and multiple tutorials, but it does not work. Here is my code: ConfigServerApplication: import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure

Setting Hystrix timeout with environment variable

被刻印的时光 ゝ 提交于 2020-05-13 03:57:05
问题 In order to change Hystrix's default request timeout (1000ms), one must set the following property : hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=2000 What is the corresponding environment variable ? I would like to "tune" the timeout on my favorite cloud platform without touching the source code first. I'm pretty sure this one doesn't work : HYSTRIX_COMMAND_DEFAULT_EXECUTION_ISOLATION_THREAD_TIMEOUT_IN_MILLISECONDS=2000 EDIT : Problem was found with Spring Cloud

Define different Feign client implementations based on environment

 ̄綄美尐妖づ 提交于 2020-03-18 06:22:48
问题 I have a Spring boot application which uses Feign to call an external web service via Eureka. I'd like to be able to run the application using a mocked out implementation of the Feign interface, so I can run the application locally without necessarily having Eureka or the external web service running. I had imagined defining a run configuration that allowed me to do this, but am struggling to get this working. The issue is that the Spring "magic" is defining a bean for the Feign interface no

spring boot application failed to autowired feign client

谁说我不能喝 提交于 2020-02-04 02:29:29
问题 created a sample project of spring boot application to understand the feign client functionality, when run it gives below error. Description: Field remoteCallClient in com.example.demo.RestClient required a bean of type 'com.example.demo.RemoteCallClient' that could not be found. Action: Consider defining a bean of type 'com.example.demo.RemoteCallClient' in your configuration. I tried various ways but it could not resolved, provided entire source code of sample project. POM.xml <?xml version

Can't configure Feign Client timeouts

 ̄綄美尐妖づ 提交于 2020-02-02 14:57:49
问题 I'm using Feign Client with disabled Load Balancer @FeignClient(name = "my-client", url = "${myHost}", configuration = ClientContext.class) So, all ribbon properties are ignored. I'm trying to set custom timeouts by different ways, but Feign ignores all them and throws TimeoutException after 60 seconds. Ways I tried to use: in ClientContext: 1) @Value("${feign.connectTimeout:10000}") private int connectTimeout; @Value("${feign.readTimeOut:300000}") private int readTimeout; @Bean public