spring-cloud-netflix

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

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

large file upload via Zuul

青春壹個敷衍的年華 提交于 2019-12-13 04:54:26
问题 I'm trying to upload a large file through Zuul. Basically I have the applications set up like this: UI: this is where the Zuul Gateway is located Backend: this is where the file must finally arrive. I used the functionality described here so everything works fine if I used "Transfer-Encoding: chunked". However, this can only be set via curl. I haven't found any way to set this header in the browser (the header is rejected with the error message in the console " Refused to set unsafe header ..

Array Multipart[] file upload using Feign client

六月ゝ 毕业季﹏ 提交于 2019-12-12 21:08:03
问题 I am trying to upload Array of Multipart file object using feign client. This is the service am trying to call using Feign client. public ResponseEntity<Object> manageFileUpload(@RequestParam("files") MultipartFile[] files) I tried using,Feign client Annotation, @FeignClient(value = "UPLOADUTILITIES", configuration = Upload.MultipartSupportConfig.class, fallback = UploadFallback.class) My Method, @RequestMapping(name = "upload", value = "/object", method = RequestMethod.POST) @Headers(

XACML for Spring Cloud

被刻印的时光 ゝ 提交于 2019-12-12 09:03:20
问题 I'm going to secure my Spring Cloud Application with OAuth2 and XACML (using AuthZForce, Balana, AT&T XACML or something similar). I want to use the microservices from Spring-Cloud(-Netflix). To make XACML available I think that I need this: PEP for each existing API-service PDP's as new services, that are used by PEP's. Because Spring-Cloud(-Netflix) has load-balancing functions (Eureka) I need to register this services on Eureka and implement a REST-API. Because all PDP's should use the

@EnableFeignClients and @FeignClient fail on Autowiring 'FeignContext' NoSuchBeanException

只谈情不闲聊 提交于 2019-12-12 08:28:28
问题 The microservice I'm writting needs to communicate to other microservices in our platform. On that attempt, the ideal solution for us is Spring Cloud Netflix Feign , implemeting a @FeignClient . However, I'm facing the exception below when I try an @Autowired ReviewProvider : Exception (cause) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.netflix.feign.FeignContext' available at org.springframework.beans

Eureka with AWS ECS

不问归期 提交于 2019-12-12 04:36:09
问题 We are using Eureka with AWS ECS service that can scale docker containers. In ECS if you leave out the host port, or specify it as being '0', in your task definition, then the port will be chosen automatically and reported back to the service. After the task is running, describing it should show what port(s) it bound to. How does Eureka can resolve what port to use if we have several EC2 instance. For example Service A from EC2-A try to call Service B from EC2-B. So Eureka can resolve

Spring Boot 2.0.0.M1: Where is the package org.springframework.bind?

允我心安 提交于 2019-12-12 04:14:32
问题 Spring Boot 1.5.3.RELEASE had several classes in org.springframework.boot.bind , especially RelaxedPropertyResolver . However, https://github.com/spring-projects/spring-boot/tree/v2.0.0.M1/spring-boot/src/main/java/org/springframework/boot doesn't contain the subdirectory bind anymore RelaxedPropertyResolver is used e.g. in org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration both in 1.3.0.RELEASE and in the current 2.0.0-BUILD-SNAPSHOT . Is there any workaround? 来源: https:/

Strange issue with spring-cloud-config-server with svn as repository

早过忘川 提交于 2019-12-11 18:05:37
问题 I am using spring-cloud-config-server with SVN as repository. When I start the cloud-config-server and client[microservice], configuration value is picked up properly. After changing a configuration value and SVN commit, I am firing refresh POST call, URL: http://localhost:8080/actuator/refresh [8080 is client port]. The updated value in SVN is not getting refreshed. It is known that config-server stores the SVN data locally.[In my case, folder location - /tmp/config-repo-5393789580706388886]

Make Spring Cloud app to wait for eureka clients to remove it before fully shutting down

余生颓废 提交于 2019-12-11 16:24:29
问题 We have an application that's receiving calls from other services that use Eureka to discover the different IP addresses of the different application instances/replicas. When deploying a new version of this app, our deployment system (kubernetes in our case) sends a SIGTERM to one of the instances of the application to shut it down. But the Eureka client in the services sending requests to the application, keeps a local cache of Eureka's information. Meaning that these applications won't