netflix-eureka

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

Setting up Eureka for non-AWS datacenter

依然范特西╮ 提交于 2019-12-24 00:06:26
问题 I have setup Eureka with 2 peers, after about 5 minutes I see this message appear in the UI: EMERGENCY! EUREKA MAY BE INCORRECTLY CLAIMING INSTANCES ARE UP WHEN THEY'RE NOT. RENEWALS ARE LESSER THAN THRESHOLD AND HENCE THE INSTANCES ARE NOT BEING EXPIRED JUST TO BE SAFE. When I look at the output from one of the running instances of Eureka, I see this: 2015-11-11 14:46:47.276 INFO 32748 --- [pool-5-thread-1] com.netflix.discovery.DiscoveryClient : The response status is 200 2015-11-11 14:56

How to handle Multipart Exception

依然范特西╮ 提交于 2019-12-23 12:17:11
问题 I am building a website for uploading pictures. I am using Spring Boot, eureka and zuul proxy.I am trying to limit the size of the user uploaded pictures. When the picture exceeds the limit it should return some message, but instead it throws a MultipartException . The problem is I don't know how to handle it. I have found a lot of examples on the net, but none of them worked for me. I found an example with servlet filter, but with no luck. I have also tried with ControllerAdvice , yet I

Auto-configure routes with Zuul and Eureka

天大地大妈咪最大 提交于 2019-12-23 05:27:53
问题 Through reading various books / tutorials, it appears that it is possible to auto-configure routes in Zuul when using it in combination with Eureka service discovery. That means that I don't have to explicitly add routes to Zull's application.properties. So I understand this correctly? Or do I still need to add routes explicitly to Zuul in order it to work as a gateway? I would like it to automatically create routes from the application name's that are registered with Eureka. Is this possible

Error creating bean with name 'eurekaInstanceConfigBean': Singleton bean creation not allowed while singletons of this factory are in destruction

这一生的挚爱 提交于 2019-12-23 04:55:22
问题 This question is extension of Working With Eureka Clients Programmatically issue - Completed shut down of DiscoveryClient. On my windows machine JAVA_HOME and PATH both versions where different. I just corrected it and now its showing me below error. Error: Invocation of destroy method failed on bean with name 'scopedTarget.eurekaClient': org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'eurekaInstanceConfigBean': Singleton bean creation not

Microservices - RestTemplate UnknownHostException

折月煮酒 提交于 2019-12-22 08:23:02
问题 I have a simple setup with a Eureka service registration server, a service for the public API and a service that gets called from the public API using RestTemplate. Eureka tells me that the services are successfully registered, but when I call the service @Service public class MyServiceService { @Autowired private RestTemplate restTemplate; private final String serviceUrl; public MyServiceService() { this.serviceUrl = "http://MY-SERVICE"; } public Map<String, String> getTest() { Map<String,

Zuul -> Eureka Server, Basic Authentication issue

谁都会走 提交于 2019-12-22 05:34:29
问题 I am able to hit the service, if the flow doesn't contain Basic Authorization. If i use Basic Authorization, it throws "message": "Full authentication is required to access this resource" Below are my observations: In ZuulFilter, run() method, i get value for request.getHeader("Authorization") --> Basic c29tOnNvbzz== but once it reaches the Micro Service, i am getting value as 'null', request.getHeader("Authorization") --> null Using Spring Boot version : 1.4.0.RELEASE This is my flow: ------

Cloud config got Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/} from Eureka server

喜夏-厌秋 提交于 2019-12-22 00:24:13
问题 I'm trying to implement Discovery First Bootstrap way for my 4 micro-services. First is a config server that takes config from git, and second is an Eureka server. When i'm running docker-compose up my config server is not able to register with eureka. I've got: Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/} Connection refused My config server @EnableConfigServer @EnableEurekaClient @SpringBootApplication public class ConfigServerApplication { public

Register multiple Instances of a Spring Boot Eureka Client from a single host

余生颓废 提交于 2019-12-21 10:16:23
问题 UPDATE The README in this repo has been updated to demonstrate the solution in the accepted answer. I'm working with a simple example of a Spring Boot Eureka service registration and discovery based on this guide. If I start up one client instance, it registers properly, and it can see itself through the DiscoveryClient . If I start up a second instance with a different name, it works as well. But if I start up two instances with the same name, the dashboard only shows 1 instance running, and

Spring Eureka: gently shutdown a service

浪尽此生 提交于 2019-12-21 05:47:08
问题 I have service A, that is using services B1 and B2 (two instances of same service), all configured via Eureka. Now I would like to take B1 gently down (so that A has not problems/delays with handling failing B1 requests). I would like to have such a procedure for that: Tell B1 to stop pinging Eureka Make Eureka spread the word, that B1 is going down Wait until A gets the info and does not use B1 anymore Then shutdown B1 I have a problem with step 1. How can I request B1 to stop pinging?