Class DistributedPropertySourceLocator

java.lang.Object
io.micronaut.discovery.client.config.DistributedPropertySourceLocator
All Implemented Interfaces:
io.micronaut.context.env.BootstrapPropertySourceLocator

@Singleton @Requires(property="micronaut.config-client.enabled", value="true", defaultValue="false") public class DistributedPropertySourceLocator extends Object implements io.micronaut.context.env.BootstrapPropertySourceLocator

A BootstrapPropertySourceLocator implementation that uses the ConfigurationClient to find available PropertySource instances from distributed configuration sources.

This implementation using a Blocking operation which is required during bootstrap which is configured to Timeout after 10 seconds. The timeout can be configured with micronaut.config.readTimeout in configuration

Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

    • DistributedPropertySourceLocator

      public DistributedPropertySourceLocator(io.micronaut.discovery.config.ConfigurationClient configurationClient, @Value("${micronaut.config-client.read-timeout:10s}") Duration readTimeout)
      Parameters:
      configurationClient - The configuration client
      readTimeout - The read timeout
  • Method Details

    • findPropertySources

      public Iterable<io.micronaut.context.env.PropertySource> findPropertySources(io.micronaut.context.env.Environment environment) throws io.micronaut.context.exceptions.ConfigurationException
      Specified by:
      findPropertySources in interface io.micronaut.context.env.BootstrapPropertySourceLocator
      Throws:
      io.micronaut.context.exceptions.ConfigurationException