spring-cloud

How to read multiple config file from Spring Cloud Config Server

放肆的年华 提交于 2019-12-03 07:26:34
Spring cloud config server supports reading property files with name ${spring.application.name}.properties . However I have 2 properties files in my application. a.properties b.properties Can I get the config server to read both these properties files? Rename your properties files in git or file system where your config server is looking at. a.properties -> <your_application_name>.properties a.properties -> <your_application_name>-<profile-name>.properties For example, if your application name is test and you are running your application on dev profile, below two properties will be used

springcloud中config启动时候报错Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'config.info' in value \"${config.info}\"

﹥>﹥吖頭↗ 提交于 2019-12-03 07:14:55
"C:\Program Files\Java\jdk1.8.0_191\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=2692 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\Program Files\JetBrains\ideaIU-2018.1.2.win\lib\idea_rt.jar=2693:D:\Program Files\JetBrains\ideaIU-2018.1.2.win\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_191\jre

Unable to get EnableOauth2Sso Working — BadCredentialsException: Could not obtain access token

て烟熏妆下的殇ゞ 提交于 2019-12-03 05:39:45
问题 I'm trying to get a simple Spring OAuth2 SSO application working and I've been unable to do so. Here's the steps and results of what's happened: Hit endpoint /user , which is secured by OAuth2 I get forwarded to a simple Spring OAuth2 authorization server I authenticate to the authorization server I approved the access Then I get a white label error page on the OAuth2 SSO application with the following: Whitelabel Error Page This application has no explicit mapping for /error, so you are

spring源码-Aware-3.4

谁都会走 提交于 2019-12-03 04:40:06
  一、Feign受 Retrofit、JAXRS-2.0和WebSocket影响 ,采用了声明式API 接口的风格,将Java Http 客户端绑定到它的内部。 Feign 首要目的是将 Java Http 客户端调用过程变得简单。   理解的简单一点就是Feign的原理就是通过Java Http的方式访问,已经编写好的接口,实现调用的简单化、解耦化。   二、我们先写一个Feign例子看看(端口8676):   1)加入依赖:    <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <

Is there a compatibility matrix of Spring-boot and Spring-cloud?

邮差的信 提交于 2019-12-03 04:16:44
问题 I am wondering if a compatibility matrix exists between Springboot and Springcloud? I created a simple project on STS and am running into compatibility issues. <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.1.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies

How is Spring Cloud Gateway different from Zuul?

眉间皱痕 提交于 2019-12-03 04:04:27
问题 I have been using Zuul as the edge service and API Gateway. Recently I have noticed that Spring Cloud Platform release Spring Cloud Gateway. What is the difference between the two gateways? Why is the Zuul not extended to support the functionalities in S-C-Gateway? What was the driving factor for a new library altogether? When should it be used? 回答1: I am the author of spring cloud gateway. Zuul is built on servlet 2.5 (works with 3.x), using blocking APIs. It doesn't support any long lived

ZuulProxy fails with “RibbonCommand timed-out and no fallback available” when it should do failover

牧云@^-^@ 提交于 2019-12-03 03:43:59
问题 Short description: I'm trying to get a ZuulProxy to handle instance failover but it throws ZuulException: Forwarding error, instead of responding with a result from a working instance. Long description: My setup is one standalone Eureka Server, one ConfigServer, one ZuulProxy (@EnableZuulProxy) and two service instances, all of them registred in Eureka. Everything is running with spring-cloud-starter-parent Angel.SR3 My servicediscovery: @SpringBootApplication @EnableEurekaServer public class

Session not replicated on session creation with Spring Boot, Session, and Redis

被刻印的时光 ゝ 提交于 2019-12-03 03:39:37
I'm attempting to implement a microservices architecture using Spring Cloud's Zuul, Eureka, and my own services. I have multiple services that have UIs and services and each can authenticate users using x509 security. Now I'm trying to place Zuul in front of those services. Since Zuul can't forward client certs to the backend, I thought the next best thing would be to authenticate the user at the front door in Zuul, then use Spring Session to replicate their authenticated state across the backend services. I have followed the tutorial here from Dave Syer and it almost works, but not on the

How to route in between microservices using Spring Cloud & Netflix OSS

强颜欢笑 提交于 2019-12-03 03:13:32
问题 During our development of microservices using Spring Cloud, we started out using Zuul as a proxy for any connection from the outside to microservices, and for any microservice needing to contact another microservice. After some time we made the conclusion that Zuul was designed to be an edge service (only proxying traffic from the outside to the microservices), and shouldn't be used for intermicroservices communication. Especially the way Spring Cloud recommends the use of eureka to make a

Eureka Server: How to achieve high availability

会有一股神秘感。 提交于 2019-12-03 02:42:56
问题 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? 回答1: 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: