Spring Cloud

Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns. They will work well in any distributed environment, including the developer's own laptop, bare metal data centres, and managed platforms such as Pivotal Cloudfoundry.

Quick Start
Fork me on GitHub

Spring Cloud builds on Spring Boot by providing a bunch of libraries that enhance the behaviour of an application when added to the classpath. You can take advantage of the basic default behaviour to get started really quickly, and then when you need to, you can configure or extend to create a custom solution.

Quick Start

You can create a Config Server with a single annotation:

@Configuration
@EnableAutoConfiguration
@EnableConfigServer
class ConfigServer {
}

This app runs from the Spring Boot CLI (once the spring-cloud-cli extensions are installed), e.g.

$ spring install org.springframework.cloud:spring-cloud-cli:1.0.0.BUILD-SNAPSHOT
$ spring run configserver.groovy -- --server.port=8888

Any other local application that includes spring-cloud-config as a dependency will be able to contact this server and pre-initialize the Spring Environment with external configuration managed by the server. The Spring Boot CLI (with the Cloud extensions) will do this automatically for all applications.

@Configuration
@EnableAutoConfiguration
@Controller
class ConfigClient {
}

Run this app with the Spring Boot CLI and then visit http://localhost:8080/env (the Environment endpoint). Notice the property sources that come from the config server at the top of the results.

(N.B. does not work if you can't connect to github.com because that's where the default configuration repository lives.)

Features

Spring Cloud focuses on providing good out of box experience for typical use cases and extensibility mechanism to cover others.

  • Distributed/versioned configuration
  • Service registration and discovery
  • Routing
  • Service-to-service calls
  • Load balancing
  • Circuit Breakers
  • Global locks
  • Leadership election and cluster state
  • Distributed messaging

Main Projects