O'Reilly logo

Spring Boot Cookbook by Alex Antonov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Externalizing environmental config using Consul and envconsul

In the previous recipe, we had our Consul service installed and experimented with its Key/Value capabilities to learn how we can manipulate the data in it. Next step would be to integrate Consul with our application and make the data extraction process seamless and non-invasive from the application's stand point.

As we don't want our application to know anything about Consul and have to explicitly connect to it—even though such a possibility exists—we will employ another utility, also created and open-sourced by Hashicorp, called envconsul to connect to the Consul service for us, extract the specified configuration key/value tree, and expose it as the environment variables to be used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required