Enabling Distributed Configuration with Consul
Using the CLI If you are creating your project using the Micronaut CLI, supply the
|
To enable distributed configuration, similar to Spring Boot and Grails, you need to create a src/main/resources/bootstrap.yml
configuration file and configure Consul as well as enable the configuration client:
bootstrap.yml
micronaut:
application:
name: hello-world
config-client:
enabled: true
consul:
client:
defaultZone: "${CONSUL_HOST:localhost}:${CONSUL_PORT:8500}"
Once you have enabled distributed configuration you need to store the configuration you wish to share in Consul’s Key/Value store.
There are a number of different ways to do that.