8.1.4 Spring Cloud Config Support

Since 1.1, Micronaut features a native Spring Cloud Configuration for those who have not switched to a dedicated more complete solution like Consul.

To enable support for Spring Cloud Configuration simply add the following configuration to your bootstrap.yml file:

Integrating with Spring Cloud Configuration

  1. micronaut:
  2. application:
  3. name: hello-world
  4. config-client:
  5. enabled: true
  6. spring:
  7. cloud:
  8. config:
  9. enabled: true
  10. uri: http://localhost:8888/
  11. retry-attempts: 4 # optional, number of times to retry
  12. retry-delay: 2s # optional, delay between retries

Micronaut will use the configured micronaut.application.name to lookup property sources for the application from Spring Cloud config server configured via spring.cloud.config.uri.

See the Documentation for Spring Cloud Config Server for more information on how to setup the server.