netflix-eureka

Eureka Server: How to achieve high availability

点点圈 提交于 2019-12-02 16:17:51
I'm new to spring cloud. I've read this doc and it says the client application must specify a service url: eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/ But what if localhost:8761 goes down? Eureka Discovery Server should be used in the Peer-Aware config mode in production setups. Check: http://cloud.spring.io/spring-cloud-static/spring-cloud.html#_peer_awareness For instance your first eureka server instance will have config like this: server: port: 1111 eureka: instance: hostname: peer1 client: serviceUrl: defaultZone: http://peer2:1112/eureka/ ..and second server

Zuul unable to route traffic to service on kubernetes

二次信任 提交于 2019-12-01 06:51:28
We have Zuul and Eureka both up and running on our kubernetes cluster. Zuul is registered with Eureka. I start up a new service called "Resource-Service" this correctly boots up and registers with Eureka, all services are up. When I attempt to hit Zuul endpoint to access "Resource-service" I get the following error. Seems like Zuul can not map to Resource-service even though resource service is registered with eureka. So how does zuul know where to route requests for "Resource-service" if not through a registered service in eureka? Note: I have tried this with Docker-compose and was able to

Spring-Cloud Zuul breaks UTF-8 symbols in forwarded multipart request filename

拈花ヽ惹草 提交于 2019-12-01 06:42:16
this is first time for me on SO, so please be patient for my first question. I think i have some kind of configuration problem, but after a day of experiments i'm stuck. Our application is based on Spring-Cloud [Brixton release]. We have configuration like this: Portal (web application serving angular-based web-ui), which has zuul proxy with single route configured to our gateway service, like so: zuul: ignoredServices: '*' prefix: /api routes: api-proxy: path: /** serviceId: api-gateway which has another Zuul configured and relays requests to inner bussiness logic services: zuul:

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

杀马特。学长 韩版系。学妹 提交于 2019-12-01 05:42:56
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 circuit should get open, fall back method called and circuit automatically closes after the services

Zuul unable to route traffic to service on kubernetes

梦想的初衷 提交于 2019-12-01 04:58:42
问题 We have Zuul and Eureka both up and running on our kubernetes cluster. Zuul is registered with Eureka. I start up a new service called "Resource-Service" this correctly boots up and registers with Eureka, all services are up. When I attempt to hit Zuul endpoint to access "Resource-service" I get the following error. Seems like Zuul can not map to Resource-service even though resource service is registered with eureka. So how does zuul know where to route requests for "Resource-service" if not

Spring-Cloud Zuul breaks UTF-8 symbols in forwarded multipart request filename

南楼画角 提交于 2019-12-01 04:11:07
问题 this is first time for me on SO, so please be patient for my first question. I think i have some kind of configuration problem, but after a day of experiments i'm stuck. Our application is based on Spring-Cloud [Brixton release]. We have configuration like this: Portal (web application serving angular-based web-ui), which has zuul proxy with single route configured to our gateway service, like so: zuul: ignoredServices: '*' prefix: /api routes: api-proxy: path: /** serviceId: api-gateway

Error when Zuul routing to a HTTPS url

橙三吉。 提交于 2019-11-30 23:31:02
I have a Spring Boot application (recently enabled it for HTTPS + self signed certificate) which is registered in Eureka and visible in the Eureka dashboard. We have a Zuul Filter layer which gets the user request and then passes it on to the Spring Boot application. This was working fine until the app was accessible via HTTP. But, once i enabled HTTPS, the zuul routing is failing. Here is the Zuul route configuration in my yaml file. Should my Zuul Route configuration have any special configuration for HTTPS enabled URL/App ? zuul: routes: ms: path: /app/** stripPrefix: true ms: ribbon:

Error when Zuul routing to a HTTPS url

梦想的初衷 提交于 2019-11-30 18:08:36
问题 I have a Spring Boot application (recently enabled it for HTTPS + self signed certificate) which is registered in Eureka and visible in the Eureka dashboard. We have a Zuul Filter layer which gets the user request and then passes it on to the Spring Boot application. This was working fine until the app was accessible via HTTP. But, once i enabled HTTPS, the zuul routing is failing. Here is the Zuul route configuration in my yaml file. Should my Zuul Route configuration have any special

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

Deadly 提交于 2019-11-30 06:47:15
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? 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 { Josh Since from the beginning of @ConditionalOnProperty it was possible to check more than one property. The name / value

Strategy for unit testing a Spring Cloud Service

浪尽此生 提交于 2019-11-30 04:34:25
Given the following Spring Cloud setup: A data-service with access to a database, an eureka-service to handle service registry and discovery and a third service business-service which will be one of various services which encapsulate business cases. Unit testing the data-service is no problem, I just turn off eureka via eureka.client.enabled=false and use an in-memory database for my tests. To access the data-service from business-service , I'm using an @FeignClient("data-service") annotated interface named DataClient which is @Autowired where needed. The service is discovered by Eureka, if