netflix-feign

Load balancer does not have available server for client

﹥>﹥吖頭↗ 提交于 2019-12-03 07:03:10
问题 I'm trying to use Feign client. Below is my feing client: import com.eprogrammerz.examples.domain.Movie; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * Created by Yogen on 12/26/2016. */ @FeignClient(name = "movie-api") public interface MovieApi { @RequestMapping(method = RequestMethod.GET,

Using @RequestLine with Feign

旧街凉风 提交于 2019-12-03 06:07:46
I have a working Feign interface defined as: @FeignClient("content-link-service") public interface ContentLinkServiceClient { @RequestMapping(method = RequestMethod.GET, value = "/{trackid}/links") List<Link> getLinksForTrack(@PathVariable("trackid") Long trackId); } If I change this to use @RequestLine @FeignClient("content-link-service") public interface ContentLinkServiceClient { @RequestLine("GET /{trackid}/links") List<Link> getLinksForTrack(@Param("trackid") Long trackId); } I get the exception Caused by: java.lang.IllegalStateException: Method getLinksForTrack not annotated with HTTP

Load balancer does not have available server for client

亡梦爱人 提交于 2019-12-03 00:22:45
I'm trying to use Feign client. Below is my feing client: import com.eprogrammerz.examples.domain.Movie; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * Created by Yogen on 12/26/2016. */ @FeignClient(name = "movie-api") public interface MovieApi { @RequestMapping(method = RequestMethod.GET, value = "/movies/{id}") Movie getMovie(@PathVariable("id") Long id); } I'm calling it from simple

Enabling Sleuth slows requests down (a lot)

萝らか妹 提交于 2019-12-01 08:54:41
问题 I use Spring Cloud Feign and Sleuth with a Zipkin server. My problem is that when I enable Sleuth, then any simple request takes at least 600ms. Note that for tests purposes, I've set the sampler percentage of Sleuth at 1. Can I do something to improve that? Here some log of a request which takes 25ms without Sleuth and 700ms with Sleuth. (user calls /teams which calls /cities): 13:46:46.064 [http-nio-8080-exec-3] DEBUG o.s.c.s.instrument.web.TraceFilter - Received a request to uri [/teams]

Does Feign retry require some sort of configuration?

心不动则不痛 提交于 2019-11-30 17:55:07
问题 I just tried to do a attempted a seamless upgrade of a service in a test setup. The service is being accessed by a Feign client. And naively I was under the impression that with multiple instances available of the service, the client would retry another instance if it failed to connect to one. That, however, did not happen. But I cannot find any mention of how Feign in Spring Cloud is supposed to be configured to do this? Although I have seen mentions of it supporting it (as opposed to using

Mock an Eureka Feign Client for Unittesting

痞子三分冷 提交于 2019-11-29 12:36:26
问题 i am using spring cloud's eureka and feign to communicate between some services (lets say A and B). Now id like to unittest my service layer of a single service (A). The problem is, that this service (A) is using a feign client to request some information of the other service (B). Running the unittests without any special configuration throws the following exception: java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client:

How to send POST request by Spring cloud Feign

六眼飞鱼酱① 提交于 2019-11-29 09:28:35
问题 It's my Feign interface @FeignClient( name="mpi", url="${mpi.url}", configuration = FeignSimpleEncoderConfig.class ) public interface MpiClient { @RequestMapping(method = RequestMethod.POST) public ResponseEntity<String> getPAReq(@QueryMap Map<String, String> queryMap ); } and my custom configuration public class FeignSimpleEncoderConfig { public static final int FIVE_SECONDS = 5000; @Bean public Logger.Level feignLogger() { return Logger.Level.FULL; } @Bean public Request.Options options() {

Error Injecting FeignClient from another Project

空扰寡人 提交于 2019-11-29 02:04:30
问题 I am having trouble auto wiring a feign client from another project. It appears that the implementation of the feign client is not being generated and injected. This is the error I am getting. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'passportRestController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.wstrater.service.contacts.client

Can a Spring Cloud Feign client share interface with an Spring Web Controller?

99封情书 提交于 2019-11-28 19:43:47
Building an endpoint and client with Spring MVC and Feign Client (with spring cloud). I had the thought that since both ends need to have the same annotations - and that they have to be pretty much in sync. Maybe I could define them in an interface and have the two ends implement that. Testing it out I was somewhat surprised that it actually works for the Spring Web end. But it I cannot find a way to do the same for a Feign client. I basically have the interface: @RequestMapping("/somebaseurl") public interface ServiceInterface { @RequestMapping(value = "/resource/{identifier}", method =

Can I configure a @FeignClient url using a properties/yml file?

≯℡__Kan透↙ 提交于 2019-11-28 19:18:48
My goal is to create a strategy of different steps to get from a point-to-point communication between 2 components to a "full blown netflix" style of communication using eureka, ribbon, hystrix. With each iteration I want to add more while I try to limit the amount of changes to the actual code. Feign is my preferred client side framework to make this happen. First step is to create a FeignClient to communicate to the server: @FeignClient(url = "http://localhost:9000") interface Client { @RequestMapping(method = RequestMethod.GET, value = "/author/{author}/addedValue/{addedValue}") Result