From 0b108c0a83636ef30b5faf827c4cbadd0d53a5bc Mon Sep 17 00:00:00 2001
From: Dave Syer
Spring Cloud Config Server also supports multiple git repositories:
+Spring Cloud Config Server pulls configuration for remote clients +from a git repository (which must be provided):
In the above example, if {application} does not match to any of the patterns -under "spring.cloud.config.server.git.repos", it will use the default uri -defined under "spring.cloud.config.server.git.uri". Acceptable pattern -format is "xxx", "xxx", or "xxx".
-Spring Cloud Config Server also supports multiple git repositories:
+Spring Cloud Config Server supports a single or multiple git +repositories:
spring:
cloud:
config:
- server:
- git:
- uri: https://github.com/spring-cloud-samples/config-repo
- repos:
- simple: https://github.com/pattern1/config-repo
+ server:
+ git:
+ uri: https://github.com/spring-cloud-samples/config-repo
+ repos:
+ simple: https://github.com/pattern1/config-repo
special:
pattern: pattern*,*pattern1*
- uri: https://github.com/pattern2/config-repo
- local:
+ uri: https://github.com/pattern2/config-repo
+ local:
pattern: local*
- uri: file:/home/configsvc/config-repo
+ uri: file:/home/configsvc/config-repo
spring:
cloud:
config:
- server:
- git:
- uri: https://github.com/spring-cloud-samples/config-repo
+ server:
+ git:
+ uri: https://github.com/spring-cloud-samples/config-repo
username: trolley
password: strongpassword
To enable the Hystrix metrics stream include a dependency on spring-boot-starter-actuator. This will expose the /hystrix.stream as a management endpoint.
<dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency>
+In some environments (e.g. in a PaaS setting), the classic Turbine model of pulling metrics from all the distributed Hystrix commands doesn’t work. In that case you might want to have your Hystrix commands push metrics to Turbine, and Spring Cloud enables that with AMQP messaging. All you need to do on the client is add a dependency to spring-cloud-netflix-hystrix-amqp and make sure there is a Rabbit brooker available (see Spring Boot documentation for details on how to configure the client credentials, but it should work out of the box for a local broker or in Cloud Foundry).
In some environments (e.g. in a PaaS setting), the classic Turbine model of pulling metrics from all the distributed Hystrix commands doesn’t work. In that case you might want to have your Hystrix commands push metrics to Turbine, and Spring Cloud enables that with AMQP messaging. All you need to do on the client is add a dependency to spring-cloud-netflix-hystrix-amqp and make sure there is a Rabbit broker available (see Spring Boot documentation for details on how to configure the client credentials, but it should work out of the box for a local broker or in Cloud Foundry).
On the server side Just create a Spring Boot application and annotate it with @EnableTurbineAmqp and by default it will come up on port 8989 (point your Hystrix dashboard to that port, any path). You can customize the port using either server.port or turbine.amqp.port. If you have spring-boot-starter-web and spring-boot-starter-actuator on the classpath as well, then you can open up the Actuator endpoints on a separate port (with Tomcat by default) by providing a management.port which is different.