Skip to Content
Cloud Native Java
book

Cloud Native Java

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

Chapter 3. Twelve-Factor Application Style Configuration

In this chapter, we’ll look at how to externalize application configuration.

The Confusing Conflation of “Configuration”

Let’s establish some vocabulary. When we talk about configuration in Spring, we’ve usually talked about the inputs into the Spring framework’s various ApplicationContext implementations that help the container understand how you want beans wired together. This might be an XML file to be fed into a ClassPathXmlApplicationContext, or Java classes annotated a certain way to be fed into an AnnotationConfigApplicationContext. Indeed, when we talk about the latter, we refer to it as Java configuration.

In this chapter, however, we’re going to look at configuration as it is defined in the Twelve-Factor application manifesto. In this instance, configuration refers to literal values that may change from one environment to another: things like passwords, ports and hostnames, or feature flags. This configuration defies magic constants embedded in the code. The manifesto provides a great litmus test for whether configuration has been done correctly: could the codebase of an application be open sourced at any moment without exposing and compromising important credentials? This sort of configuration refers only to the values that change from one environment to another; not, for example, to Spring bean wiring or Ruby route configuration.

Support in Spring Framework

Spring has supported twelve-factor–style configuration ...

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 Java with Kubernetes, 2nd Edition

Cloud Native Java with Kubernetes, 2nd Edition

Josh Long
Cloud Native Patterns

Cloud Native Patterns

Cornelia Davis

Publisher Resources

ISBN: 9781449374631Errata PageSupplemental Content