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
-
Field Summary
Fields inherited from interface io.micronaut.context.env.BootstrapPropertySourceLocator
EMPTY_LOCATOR
-
Constructor Summary
ConstructorDescriptionDistributedPropertySourceLocator
(io.micronaut.discovery.config.ConfigurationClient configurationClient, Duration readTimeout) -
Method Summary
Modifier and TypeMethodDescriptionIterable<io.micronaut.context.env.PropertySource>
findPropertySources
(io.micronaut.context.env.Environment environment)
-
Constructor Details
-
DistributedPropertySourceLocator
public DistributedPropertySourceLocator(io.micronaut.discovery.config.ConfigurationClient configurationClient, @Value("${micronaut.config-client.read-timeout:10s}") Duration readTimeout) - Parameters:
configurationClient
- The configuration clientreadTimeout
- 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 interfaceio.micronaut.context.env.BootstrapPropertySourceLocator
- Throws:
io.micronaut.context.exceptions.ConfigurationException
-