Git Product home page Git Product logo

spring-cloud-connectors's Introduction

Spring Cloud Connectors Build Status

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 multiple clouds, 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 configuration for development and testing.

The core concepts used in this project are:

  • Cloud connector: An interface specific to a cloud platform that identifies the presence of the platform and discovers any services bound to the application deployment.
  • Service connector: An object, such as a javax.sql.DataSource, that represents a runtime connection to a service.
  • Service information: Information about the underlying service such as host, port, and credentials.
  • Application information: Information about the application and the particular running instance.

The project contains three major submodules:

  • core: The core library, cloud- and Spring-agnostic, that provides a programmatic entry point for developers who prefer to access cloud services and application information manually. It also provides basic service definitions for several common services (databases, message queues) and an SPI-based extension mechanism to contribute cloud and service connectors.
  • spring-service-connector: A Spring Library that exposes application and cloud information and discovered services as Spring beans of the appropriate type. For example, SQL services will be exposed as javax.sql.DataSources with optional connection pooling.
  • Cloud connectors:
  • cloudfoundry-connector: Connector for Cloud Foundry.
  • heroku-connector: Connector for Heroku.
  • localconfig-connector: Properties-based connector for manually providing configuration information for development or testing. Allows the use of the same Spring Cloud configuration wiring in all stages of application deployment.

##Getting Started

The following examples are written for Maven; simply include the appropriate dependencies for your build system.

###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.

<!-- to use Spring Cloud Connectors for development -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-localconfig-connector</artifactId>
    <version>1.1.1.RELEASE</version>
</dependency>

<!-- If you intend to deploy the app to Cloud Foundry -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-cloudfoundry-connector</artifactId>
    <version>1.1.1.RELEASE</version>
</dependency>

<!-- If you intend to deploy the app to Heroku -->
<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-heroku-connector</artifactId>
	<version>1.1.1.RELEASE</version>
</dependency>

###Spring applications

Add the spring-service-connector in addition to your cloud connectors:

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-spring-service-connector</artifactId>
	<version>1.1.1.RELEASE</version>
</dependency>

<!-- to use Spring Cloud for development -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-localconfig-connector</artifactId>
    <version>1.1.1.RELEASE</version>
</dependency>

<!-- If you intend to deploy the app to Cloud Foundry -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-cloudfoundry-connector</artifactId>
    <version>1.1.1.RELEASE</version>
</dependency>

<!-- If you intend to deploy the app to Heroku -->
<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-heroku-connector</artifactId>
	<version>1.1.1.RELEASE</version>
</dependency>

Then follow the instructions on Spring configuration using Java configuration or the <cloud> namespace.

###Non-Spring applications

The spring-cloud-core dependency is included by each cloud connector, so simply include the connectors for the platforms you want.

Then follow the instructions on using the Spring Cloud Connectors API.

spring-cloud-connectors's People

Contributors

chrisjs avatar chrylis avatar jbcpollak avatar jdeppe-pivotal avatar jhiemer avatar mariobriggs avatar ramnivas avatar rmorgan avatar scottfrederick avatar soudmaijer avatar spencergibb avatar spring-builds avatar viniciusccarvalho avatar wgautier avatar wilkinsona avatar xtreme-allan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.