netflix-eureka

Spring Boot with server.contextPath set vs. URL to hystrix.stream via Eureka Server

泄露秘密 提交于 2019-12-20 07:08:12
问题 I have Eureka Server with Turbine instance running and a few discovery clients that are connected to it. Everything works fine, but if I register a discovery client that has server.contextPath set, it didn't get recognized by InstanceMonitor and Turbine stream is not able to combine its hystrix.stream . This is how it looks in the logs of Eureka/Turbine server: 2015-02-12 06:56:23.265 INFO 1 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Hosts up:3, hosts down: 0 2015-02-12 06:56:23.266

Understanding Spring Cloud Eureka Server self preservation and renew threshold

杀马特。学长 韩版系。学妹 提交于 2019-12-19 12:02:04
问题 I am new to developing microservices, although I have been researching about it for a while, reading both Spring's docs and Netflix's. I have started a simple project available on Github. It is basically a Eureka server (Archimedes) and three Eureka client microservices (one public API and two private). Check github's readme for a detailed description. The point is that when everything is running I would like that if one of the private microservices is killed, the Eureka server realizes and

Spring cloud - how to get benefits of retry,load balancing and circuit breaker for distributed spring application

核能气质少年 提交于 2019-12-19 06:57:31
问题 I want the following features in spring-cloud-Eureka backed microservices application. 1) Load balancing - if I have 3 nodes for one service, load balancing should happen between them 2)Retry logic - if one of the nodes did not respond, retry should happen for certain number ( eg 3. should be configurable) before falling back to another node. 3)circuit breaker - if for some reasons, all the 3 nodes of service is having some issue accessing db and throwing exceptions or not responding, the

How to check two condition while using @ConditionalOnProperty or @ConditionalOnExpression

谁说胖子不能爱 提交于 2019-12-18 12:17:03
问题 I need to check that two conditions are satisfied on a YAML property file, while creating a bean. How do I do that, as the @ConditionalOnProperty annotation supports only one property? 回答1: Use @ConditionalOnExpression annotation and SpEL expression as described here http://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html. Example: @Controller @ConditionalOnExpression("${controller.enabled} and ${some.value} > 10") public class WebController { 回答2: Since

Eureka peers not synchronized

烈酒焚心 提交于 2019-12-18 03:43:38
问题 I'm prototyping a set of Spring Cloud + Netflix OSS applications and have run into trouble with Eureka. In our setup, we have a Spring Cloud Config Server + Eureka Server, and then 2 modules that utilize that server component for bootstrapping and service discovery. The problem I run into is that if I spin up 2 instances of the Eureka Server and try to pair them (based on the Two Peer Aware Eureka Servers in the docs) they don't synchronize with each other. See configs below and/or the code

How to selectively disable Eureka discovery client with Spring?

帅比萌擦擦* 提交于 2019-12-17 18:38:31
问题 Is there a way to disable spring-boot eureka client registration based on the spring profile? Currently I use the following annotations: @Configuration @EnableAutoConfiguration @EnableDiscoveryClient @EnableConfigServer public class ConfigApplication { public static void main(String[] args) { SpringApplication.run(ConfigApplication.class, args); } } What I need is either a conditional such as (excuse the pseudo code) @if (Profile!="development") @EnableDiscoveryClient @endif Or some way in

Understanding Spring Cloud Eureka Server self preservation and renew threshold

廉价感情. 提交于 2019-12-17 05:36:12
问题 I am new to developing microservices, although I have been researching about it for a while, reading both Spring's docs and Netflix's. I have started a simple project available on Github. It is basically a Eureka server (Archimedes) and three Eureka client microservices (one public API and two private). Check github's readme for a detailed description. The point is that when everything is running I would like that if one of the private microservices is killed, the Eureka server realizes and

Eureka Server while starting in spring boot getting the errors

早过忘川 提交于 2019-12-13 03:36:33
问题 While starting the Eureka Server Unable to start getting the errors Tried with changing the cloud release changing the versions <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.0.RELEASE<

Run eureka service in a docker container

a 夏天 提交于 2019-12-12 17:46:12
问题 I want to run eureka-server as container and want to let other microservices register to this container later on. But I got some issues to let it run as container and access it. The application is running in STS without issues. When I execute it in STS I can access the eureka-server using localhost:8761 . application.java: package hello; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud

Spring Cloud Netflix and Docker Compose - cannot register services with eureka

送分小仙女□ 提交于 2019-12-12 14:49:51
问题 I'm trying to use docker-compose to run 2 simple services locally (Ubuntu): a eureka server, and config server (which is also a eureka client). Both of these have simple dockerfiles that run java -jar , expose their ports, and individually work fine. I also tried to add eureka.client.service-url.defaultZone=http://company-service-discovery:8761/eureka to see if it would register itself, and it worked. My config server cannot successfully register to the eureka server, and I've googled it and