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