Introduction
Spring Cloud Connectors provides a simple abstraction for JVM-based applications running on cloud platforms to discover bound services and deployment information at runtime, and provides support for registering discovered services as Spring beans. It is based on a plugin model so that the identical compiled application can be deployed locally or on any of multiple cloud platforms, and it supports custom service definitions through Java SPI.
Spring Cloud Connectors provides out-of-the-box support for discovering common services on Heroku and Cloud Foundry clouds, as well as a properties-based connector that can supply configuration for development and testing.
Concepts
The core Connectors concepts are:
Submodules
The project contains three major submodules.
Getting Started
See below for examples of how to include the appropriate dependencies using your build system.
Including cloud connectors
+Including Cloud Connectors
Include the connector for each cloud platform you want to be discoverable. Including multiple connectors is perfectly fine; each connector will determine whether it should be active in a particular environment.
Spring applications
+Spring Applications
If you’re writing a Spring application, include the spring-service-connector in addition to your cloud connectors.
Non-Spring applications
+Non-Spring Applications
The spring-cloud-core dependency is included by each cloud connector, so simply include the connectors for the platforms you want.