spring-cloud

How to delete file from S3 using Spring cloud AWS?

元气小坏坏 提交于 2019-12-10 18:55:52
问题 I could not find any API or documentation in Spring AWS Cloud to delete an object from S3 bucket. Can someone please let me know how to do it? The documentation just talks about reading the content using ResourceLoader . Only option right now I see is to explicitly inject AmazonS3 and call deleteObject . 回答1: Spring's Resource API does not support the full lifecycle of operations. The two main interfaces are Resource and WritableResource . There is no API for deletion. As an alternative you

Spring oauth2 hasRole access denied

Deadly 提交于 2019-12-10 17:34:56
问题 I am really new to OAuth2 and trying to build one server in roles auth.server for authorizing users and one keeping a protected resource... I've got issues to secure with the ResourceServerConfigurerAdapter. It seems like he is ignoring all it's roles fetching form userInfoUrl... so here the code: AuthServer @SpringBootApplication @EnableAuthorizationServer @EnableResourceServer @RestController public class Oa2AuthServerApplication { @RequestMapping("/user") public Principal user(Principal

Spring Cloud Zuul: how to add route without restart

萝らか妹 提交于 2019-12-10 17:13:14
问题 I am writing microservices with Spring Cloud. I'm also using Zuul as the API Gateway which routes some URLs to destination services which are not registered into Eureka. When a new route needed to be added to Zuul, we often edit the application.yml file and then restart the Zuul server. I was wondering is there a way to add new route into Zuul without restarting the Zuul server? I found this link useful but it only works for services registed in Erueka. 来源: https://stackoverflow.com/questions

Ribbon load balance algorithms

烈酒焚心 提交于 2019-12-10 15:53:49
问题 I am using Spring Cloud with NetflixOSS in my microservice project. Also, I am using Ribbon with Feign Client as my client side load balancer. I was wondering, is there any possibility to implement or choose different types of load balancing algorithms for Ribbon? Because as I understood, the default is round robin. Thanks in advance! 回答1: Yes, it is possible. See the docs for full details how to customize. For a @FeignClient("foo") and a random load-balancing rule you could do:

Zuul behind an AWS ELB over HTTPS/SSL

醉酒当歌 提交于 2019-12-10 15:17:13
问题 I have an AWS Elastic Load Balancer with the certificates for my domain and which terminates the SSL traffic. The ELB has a listener on the https port and forwards it as http to Zuul . When I use Spring Boot HATEOAS , Zuul will replace the links with the correct address but with http instead of https : "_links": { "self": { "href": "http://my.domain.com:80/rest/foo/bar" } } but what I want is: "_links": { "self": { "href": "https://my.domain.com/rest/foo/bar" } } The request that generates

Does Spring Cloud Feign client call execute inside hystrix command?

半城伤御伤魂 提交于 2019-12-10 14:17:53
问题 I'm configuring a sample application using this example: http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance. In this section http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-ribbon it is said that: Feign already uses Ribbon, so if you are using @FeignClient then this section also applies Does that mean that @FeignClient uses Hystrix too? Does the call to feign client execute inside hystrix command? if so, what is the proper way to pass

Disadvantages of using eureka for Service Discovery with kubernetes

穿精又带淫゛_ 提交于 2019-12-10 13:48:08
问题 Context I am deploying a set of services that are containerised using Docker into AWS. No matter which deployment solution is chosen (e.g. raw EC2/ECS/Elastic Beanstalk/Fargate) we will face the issue of "service discovery". To name just a few of the options for service discovery that I've considered: AWS Route 53 Service Registry Kubernetes Hashicorp Consul Spring Cloud Netflix Eureka Specifics Of My Stack I am developing Java Spring Boot applications using Spring Cloud with the target

Spring boot-Exception in thread “main” java.lang.NoSuchMethodError: org.springframew..(Version Issue)

自古美人都是妖i 提交于 2019-12-10 11:49:35
问题 I am getting Exception while running server .I know it is version issue of Spring boot and spring-cloud . But I am using spring boot 1.4.2.RELEASE and currently spring cloud using Finchley.SR1 . What is suitable version of spring cloud with spring boot 1.4.2.RELEASE? Getting exception below: Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Class;)V at org.springframework.cloud.bootstrap

Spring cloud with RDS, hello world

≡放荡痞女 提交于 2019-12-10 11:46:12
问题 I am newbie to Spring Cloud and wanted to write a simple "hello world" RDS program. My configuration is stored in the xml config as follows. <aws-context:context-credentials> ... </aws-context:context-credentials> <aws-context:context-region region="ap-southeast-1" /> <jdbc:data-source db-instance-identifier="amazonrds" password="${password}" read-replica-support="false"> <jdbc:pool-attributes initialSize="1" defaultCatalog="Records" testOnBorrow="true" validationQuery="SELECT 1" /> </jdbc

Exporting Client Cert to Backend with Zuul

大兔子大兔子 提交于 2019-12-10 11:36:37
问题 It is possible to export/forward the client certificate to the backend services using Zuul as a proxy/load balancer? I finally have a working example of zuul with spring-cloud using https and forwarding requests to a secure service on the backend using https as well. Now I need to forward the client's certificate information in addition to using https. You can do this with Apache and Tomcat using the SSLOptions +StdEnvVars/+ExportCertData, which adds the information to the headers, but I don