Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.19 KB

File metadata and controls

31 lines (24 loc) · 1.19 KB

Lesson 3: Reaching For The Clouds (Consume Cloud Services using Cloud Connectors)

Introduction

This example shows how you can bind services from you cloud provider to Spring using spring-cloud-connectors. The provides a nice abstraction that allows your application to be portable across different providers.

Prerequisites

You will need a Cloud Foundry account and the cf command line tool installed. You will also need a service named ll-car-sql-database if you don’t already have it:

$ cf create-service elephantsql turtle ll-car-sql-database

Pushing the application to Cloud Foundry

To push the application type:

$ cf push ll-cc -p target/livelessons-cloud-connectors-1.0.0-SNAPSHOT.jar

Understanding the application

The spring-cloud-connectors project will create a dataSource bean for the bound service. Look at the /beans endpoint to see how its bean name matches the service name.

You can also use the /cloudinfo URL (See ExampleController) to view the ApplicationInstanceInfo which is provided by spring-cloud-connectors.