Class RegistrationConfiguration

java.lang.Object
io.micronaut.discovery.registration.RegistrationConfiguration
All Implemented Interfaces:
Toggleable

public abstract class RegistrationConfiguration extends Object implements Toggleable
Common configuration for ServiceInstance registration.
Since:
1.0
Author:
graemerocher
  • Field Details

    • PREFIX

      public static final String PREFIX
      The prefix to use for all client discovery registration settings.
      See Also:
    • DEFAULT_ENABLED

      public static final boolean DEFAULT_ENABLED
      The default enable value.
      See Also:
    • DEFAULT_RETRY_COUNT

      public static final int DEFAULT_RETRY_COUNT
      The default retry count value.
      See Also:
    • DEFAULT_RETRYDELAY_SECONDS

      public static final int DEFAULT_RETRYDELAY_SECONDS
      The default retry delay in seconds.
      See Also:
    • DEFAULT_DEREGISTER

      public static final boolean DEFAULT_DEREGISTER
      The default deregister value.
      See Also:
    • DEFAULT_FAILFAST

      public static final boolean DEFAULT_FAILFAST
      The default fail fast value.
      See Also:
  • Constructor Details

    • RegistrationConfiguration

      public RegistrationConfiguration()
  • Method Details

    • getIpAddr

      public Optional<String> getIpAddr()
      The IP address to use to register.
      Returns:
      The IP address.
    • setIpAddr

      public void setIpAddr(@Nullable @Nullable String ipAddr)
      The IP address to use to register.
      Parameters:
      ipAddr - The ip address
    • isPreferIpAddress

      public boolean isPreferIpAddress()
      Should the IP address by used to register with the discovery server. Defaults to false.
      Returns:
      True if the IP address should be used.
    • setPreferIpAddress

      public void setPreferIpAddress(boolean preferIpAddress)
      Sets whether the IP address by used to register with the discovery server. Defaults to false.
      Parameters:
      preferIpAddress - True if the IP address should be used
    • getTimeout

      public Optional<Duration> getTimeout()
      Returns:
      The default timeout for registration
    • setTimeout

      public void setTimeout(Duration timeout)
      Parameters:
      timeout - The timeout for registration
    • isFailFast

      public boolean isFailFast()
      Returns:
      Whether to fail server startup if registration fails
    • setFailFast

      public void setFailFast(boolean failFast)
      Default value (true).
      Parameters:
      failFast - Whether to fail server startup if registration fails
    • isDeregister

      public boolean isDeregister()
      Returns:
      Whether to deregister the service on shutdown
    • setDeregister

      public void setDeregister(boolean deregister)
      Default value (true).
      Parameters:
      deregister - Whether to deregister the service on shutdown
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Toggleable
      Returns:
      Whether service registration is enabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Default value (true).
      Parameters:
      enabled - Whether service registration is enabled
    • getRetryCount

      public int getRetryCount()
      Returns:
      The number of times to retry registration
    • setRetryCount

      public void setRetryCount(int retryCount)
      Default value (-1).
      Parameters:
      retryCount - The retry count
    • getRetryDelay

      public Duration getRetryDelay()
      Returns:
      The default retry delay
    • setRetryDelay

      public void setRetryDelay(Duration retryDelay)
      Default value (1 seconds).
      Parameters:
      retryDelay - The retry delay
    • getHealthPath

      public Optional<String> getHealthPath()
      Returns:
      The path to the health endpoint
    • setHealthPath

      public void setHealthPath(String healthPath)
      Parameters:
      healthPath - The health endpoint path