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 Details

    • ConsulConfiguration

      public ConsulConfiguration(Map<String,String> params)
      Creates a new ConsulConfiguration
      Parameters:
      params - the parameters, must not be null
    • ConsulConfiguration

      public ConsulConfiguration()
      Creates a new ConsulConfiguration
  • Method Details

    • type

      public String type()
      Specified by:
      type in interface io.smallrye.stork.api.config.ConfigWithType
      Returns:
      the type
    • parameters

      public Map<String,String> parameters()
      Specified by:
      parameters in interface io.smallrye.stork.api.config.ConfigWithType
      Returns:
      the parameters
    • getConsulHost

      public String getConsulHost()
      The Consul host. By default: localhost
      Returns:
      the configured consul-host, localhost if not set
    • withConsulHost

      public ConsulConfiguration withConsulHost(String value)
      Set the 'consul-host' attribute. Default is localhost.
      Parameters:
      value - the value for consul-host
      Returns:
      the current ConsulConfiguration to chain calls
    • getConsulPort

      public String getConsulPort()
      The Consul port. By default: 8500
      Returns:
      the configured consul-port, 8500 if not set
    • withConsulPort

      public ConsulConfiguration withConsulPort(String value)
      Set the 'consul-port' attribute. Default is 8500.
      Parameters:
      value - the value for consul-port
      Returns:
      the current ConsulConfiguration to chain calls
    • getUseHealthChecks

      public String getUseHealthChecks()
      Whether to use health check. By default: true
      Returns:
      the configured use-health-checks, true if not set
    • withUseHealthChecks

      public ConsulConfiguration withUseHealthChecks(String value)
      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

      public String getApplication()
      The application name; if not defined Stork service name will be used.
      Returns:
      the configured application, @{code null} if not set
    • withApplication

      public ConsulConfiguration withApplication(String value)
      Set the 'application' attribute.
      Parameters:
      value - the value for application
      Returns:
      the current ConsulConfiguration to chain calls
    • getRefreshPeriod

      public String getRefreshPeriod()
      Service discovery cache refresh period. By default: 5M
      Returns:
      the configured refresh-period, 5M if not set
    • withRefreshPeriod

      public ConsulConfiguration withRefreshPeriod(String value)
      Set the 'refresh-period' attribute. Default is 5M.
      Parameters:
      value - the value for refresh-period
      Returns:
      the current ConsulConfiguration to chain calls
    • getSecure

      public String getSecure()
      whether the connection with the service should be encrypted with TLS.
      Returns:
      the configured secure, @{code null} if not set
    • withSecure

      public ConsulConfiguration withSecure(String value)
      Set the 'secure' attribute.
      Parameters:
      value - the value for secure
      Returns:
      the current ConsulConfiguration to chain calls