netflix-ribbon

Eureka not able to find port when running microservices on random port

孤者浪人 提交于 2020-01-06 04:09:48
问题 I am using eureka for service discover and ribbon for load balancing in my spring boot application. When i run my micro services which are registered with eureka on a fix port it works fine but when i run them on random port though i can see services registered on eureka dashboard it is not able to find the port number. and i get the following error when trying to hit the service. 2018-11-27 07:55:15.853 INFO 7240 --- [nio-8079-exec-1] c.n.l.DynamicServerListLoadBalancer :

How to capture log on each instance of the microservice through zuul

耗尽温柔 提交于 2019-12-24 11:13:04
问题 I have setup multiple instances of my microservice and registered to my eureka server. It uses ribbon for client side load balancing and uses zuul as gateway server. All usual stuff. I would like to capture the logs of which instance of my service is responding for each request. So that I can able to bring some conclusion based on my usage of each instances. How to do that? 回答1: You can try to set the loglevel just of the LoadBalancerContext to debug in application.properties #logging logging

Ribbon Retry properties not respected

南楼画角 提交于 2019-12-24 10:35:59
问题 I have a zuul gateway application, that receives requests from a client app and forwards the requests using load balanced rest template to a micro service with 2 endpoints, say endpoint1 and endpoint2 (load balancing between the two end points in round robbin which is okay for now, although I want it to be availability based). Here are the issues I am facing - I brought down one of the end points, say endpoint2 and tried calling the zuul route and I see that when the request is going to the

Feign + Ribbon request interception AFTER target host is choosen

核能气质少年 提交于 2019-12-24 02:07:22
问题 What I'm currently doing (which is very simple and convenient way): Feign.builder() .client(RibbonClient.create()) ... .requestInterceptor(new MyInterceptor()) But interception occur before ribbon actually resolve target host. Problem is, that one header that I want to add, have to be created based on the name of the target host. Is there anyway I can manipulate headers after host is resolved? 回答1: I have found following solution for this problem. Instead of using Feign interceptor I use

Eureka Ribbon LoadBalancer Cache update delay

孤街醉人 提交于 2019-12-24 00:38:52
问题 I am setting up a micro service based application, where Aggregation layer / API gateway makes calls to micro services. Eureka is used for service discovery and Ribbon for providing a load balancing RestTemplate. Postman calls Aggregation--> Aggregation calls Micro service using Eureka/Ribbon/RestTemplate. I have 4 instances of one micro services type running on my machine on 4 different ports. Hitting the same REST endpoint repeatedly Postman causes the requests to get load balanced properly

Zuul/Ribbon/Hystrix not retrying on different instance

别来无恙 提交于 2019-12-18 15:50:19
问题 Background I'm using Spring cloud Brixton.RC2, with Zuul and Eureka. I have one gateway service with @EnableZuulProxy and a book-service with a status method. Via configuration I can emulate work on the status method by sleeping a defined amount of time. The Zuul route is simple zuul.routes.foos.path=/foos/** zuul.routes.foos.serviceId=reservation-service I run two instances of the book-service . When I set the sleeping time below the Hystrix timeout threshold (1000ms) I can see requests

Ribbon with Spring Cloud and Eureka: java.lang.IllegalStateException: No instances available for Samarths-MacBook-Pro.local

感情迁移 提交于 2019-12-12 08:24:57
问题 I am working on Spring Boot Eureka Client Application with Ribbon Load Balancer. I have two instances of the server registered with Eureka with the name "TEST". On the client side, I have the following code to fetch the server from Eureka. @Configuration @ComponentScan @EnableAutoConfiguration @EnableEurekaClient @RestController public class EurekaConsumerApplication { @Autowired DiscoveryClient discoveryClient; @Autowired RestTemplate restTemplate; @RequestMapping(value = "/",method =

com.netflix.zuul.exception.ZuulException: Hystrix Readed time out

假装没事ソ 提交于 2019-12-11 04:57:24
问题 I am trying microservices with eureka and zuul. And there is a problem with all requests, which take more then 1 second. As I have understood, 1 second is default hystrix timeout, and for configuring timeouts in Zuul, I have to configure these properties: hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds ribbon.ConnectTimeout ribbon.ReadTimeout but when I set them, there is "Cannot resolve configuration property ..." warning on each of them in the Intelije Idea. And, it

Create a Custom Spring Cloud Netflix Ribbon Client

我与影子孤独终老i 提交于 2019-12-08 08:04:09
问题 I am using Spring Cloud Netflix Ribbon in combination with Eureka in a Cloud Foundry environment. The use case I am trying to implement is the following: I have a running CF application named address-service with several instances spawned. The instances are registering to Eureka by the service name address-service I have added custom metadata to service instances using eureka.instance.metadata-map.applicationId: ${vcap.application.application_id} I want to use the information in Eureka's

How can I adjust load balancing rule by feign in spring cloud

天大地大妈咪最大 提交于 2019-12-06 05:42:00
问题 As I know, feign include ribbon's function, and I prove it in my code. When I use feign, the default rule is Round Robin Rule. But how can I change the rule in my feign client code, is ribbon the only way? Here is my code below, so please help. ConsumerApplication.java @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients @EnableCircuitBreaker public class ConsumerApplication { public static void main(String[] args) { SpringApplication.run(ConsumerApplication.class, args); } }