Skip to Main Content
Cloud Native Java
book

Cloud Native Java

by Josh Long, Kenny Bastani
August 2017
Intermediate to advanced content levelIntermediate to advanced
648 pages
15h 52m
English
O'Reilly Media, Inc.
Content preview from Cloud Native Java

Chapter 14. Service Brokers

A backing service is a service (databases, message queues, email services, etc.) that an application consumes at runtime, over the network. Cloud Foundry applications consume backing services by looking for their locators and credentials in an environment variable called VCAP_SERVICES. The simplicity of this approach is a feature: any language can pluck the environment variable out of the environment and parse the embedded JSON to extract things like service hosts, ports, and credentials. The code of an application should make no distinction as to whether the backing service is local, or provided and managed by the platform. This decoupling makes it easy for an application to migrate from one environment to another: simply redefine the environment variable with environment-appropriate values and restart the application.

In Cloud Foundry, applications talk to all services through this indirection. Cloud Foundry manages a set of backing services and a set of applications. An operator must specify which applications can see the connection information for a particular backing service. This is called a service binding. A single application may be bound to many backing services, and many applications may be bound to a single backing service. There are two ways to contribute services to be bound to applications in Cloud Foundry: service brokers and user-defined services. Ultimately, they both end up as entries in the VCAP_SERVICES environment variable.

An ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cloud Native Go

Cloud Native Go

Matthew A. Titmus

Publisher Resources

ISBN: 9781449374631Errata PageSupplemental Content