Class ConsulConfiguration
java.lang.Object
io.smallrye.stork.servicediscovery.consul.ConsulConfiguration
- All Implemented Interfaces:
io.smallrye.stork.api.config.ConfigWithType
public class ConsulConfiguration
extends Object
implements io.smallrye.stork.api.config.ConfigWithType
Configuration for the
ConsulServiceDiscoveryProvider ServiceDiscovery.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ConsulConfigurationConsulConfiguration(Map<String, String> params) Creates a new ConsulConfiguration -
Method Summary
Modifier and TypeMethodDescriptionThe application name; if not defined Stork service name will be used.The Consul host.The Consul port.Service discovery cache refresh period.whether the connection with the service should be encrypted with TLS.Whether to use health check.type()withApplication(String value) Set the 'application' attribute.withConsulHost(String value) Set the 'consul-host' attribute.withConsulPort(String value) Set the 'consul-port' attribute.withRefreshPeriod(String value) Set the 'refresh-period' attribute.withSecure(String value) Set the 'secure' attribute.withUseHealthChecks(String value) Set the 'use-health-checks' attribute.
-
Constructor Details
-
ConsulConfiguration
Creates a new ConsulConfiguration- Parameters:
params- the parameters, must not benull
-
ConsulConfiguration
public ConsulConfiguration()Creates a new ConsulConfiguration
-
-
Method Details
-
type
- Specified by:
typein interfaceio.smallrye.stork.api.config.ConfigWithType- Returns:
- the type
-
parameters
- Specified by:
parametersin interfaceio.smallrye.stork.api.config.ConfigWithType- Returns:
- the parameters
-
getConsulHost
The Consul host. By default: localhost- Returns:
- the configured consul-host,
localhostif not set
-
withConsulHost
Set the 'consul-host' attribute. Default is localhost.- Parameters:
value- the value for consul-host- Returns:
- the current ConsulConfiguration to chain calls
-
getConsulPort
The Consul port. By default: 8500- Returns:
- the configured consul-port,
8500if not set
-
withConsulPort
Set the 'consul-port' attribute. Default is 8500.- Parameters:
value- the value for consul-port- Returns:
- the current ConsulConfiguration to chain calls
-
getUseHealthChecks
Whether to use health check. By default: true- Returns:
- the configured use-health-checks,
trueif not set
-
withUseHealthChecks
Set the 'use-health-checks' attribute. Default is true.- Parameters:
value- the value for use-health-checks- Returns:
- the current ConsulConfiguration to chain calls
-
getApplication
The application name; if not defined Stork service name will be used.- Returns:
- the configured application, @{code null} if not set
-
withApplication
Set the 'application' attribute.- Parameters:
value- the value for application- Returns:
- the current ConsulConfiguration to chain calls
-
getRefreshPeriod
Service discovery cache refresh period. By default: 5M- Returns:
- the configured refresh-period,
5Mif not set
-
withRefreshPeriod
Set the 'refresh-period' attribute. Default is 5M.- Parameters:
value- the value for refresh-period- Returns:
- the current ConsulConfiguration to chain calls
-
getSecure
whether the connection with the service should be encrypted with TLS.- Returns:
- the configured secure, @{code null} if not set
-
withSecure
Set the 'secure' attribute.- Parameters:
value- the value for secure- Returns:
- the current ConsulConfiguration to chain calls
-