Record Class ConfigReloadProperties

java.lang.Object
java.lang.Record
org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadProperties
Record Components:
enabled - Enables the Kubernetes configuration reload on change.
monitoringConfigMaps - Enables monitoring on secrets to detect changes.
monitoringSecrets - Monitor secrets or not.
strategy - Sets reload strategy for Kubernetes configuration reload on change.
mode - Sets the detection mode for Kubernetes configuration reload.
period - Sets the polling period to use when the detection mode is POLLING.
namespaces - namespaces where an informer will be set-up. this property is only relevant for event based reloading.
enableReloadFiltering - create an informer only for sources that have 'spring.cloud.kubernetes.config.informer.enabled=true' label. This property is only relevant for event based reloading.
maxWaitForRestart - Restart or Shutdown strategies are used, Spring Cloud Kubernetes waits a random amount of time before restarting. This is done in order to avoid having all instances of the same application restart at the same time. This property configures the maximum of amount of wait time from the moment the signal is received that a restart is needed until the moment the restart is actually triggered

@ConfigurationProperties(prefix="spring.cloud.kubernetes.reload") public record ConfigReloadProperties(boolean enabled, boolean monitoringConfigMaps, boolean monitoringSecrets, ConfigReloadProperties.ReloadStrategy strategy, ConfigReloadProperties.ReloadDetectionMode mode, Duration period, Set<String> namespaces, boolean enableReloadFiltering, Duration maxWaitForRestart) extends Record
General configuration for the configuration reload.
Author:
Nicola Ferraro
  • Field Details

  • Constructor Details

    • ConfigReloadProperties

      public ConfigReloadProperties(boolean enabled, @DefaultValue("true") boolean monitoringConfigMaps, boolean monitoringSecrets, @DefaultValue("REFRESH") ConfigReloadProperties.ReloadStrategy strategy, @DefaultValue("EVENT") ConfigReloadProperties.ReloadDetectionMode mode, @DefaultValue("15000ms") Duration period, @DefaultValue Set<String> namespaces, boolean enableReloadFiltering, @DefaultValue("2s") Duration maxWaitForRestart)
      Creates an instance of a ConfigReloadProperties record class.
      Parameters:
      enabled - the value for the enabled record component
      monitoringConfigMaps - the value for the monitoringConfigMaps record component
      monitoringSecrets - the value for the monitoringSecrets record component
      strategy - the value for the strategy record component
      mode - the value for the mode record component
      period - the value for the period record component
      namespaces - the value for the namespaces record component
      enableReloadFiltering - the value for the enableReloadFiltering record component
      maxWaitForRestart - the value for the maxWaitForRestart record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • monitoringConfigMaps

      public boolean monitoringConfigMaps()
      Returns the value of the monitoringConfigMaps record component.
      Returns:
      the value of the monitoringConfigMaps record component
    • monitoringSecrets

      public boolean monitoringSecrets()
      Returns the value of the monitoringSecrets record component.
      Returns:
      the value of the monitoringSecrets record component
    • strategy

      Returns the value of the strategy record component.
      Returns:
      the value of the strategy record component
    • mode

      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • period

      public Duration period()
      Returns the value of the period record component.
      Returns:
      the value of the period record component
    • namespaces

      public Set<String> namespaces()
      Returns the value of the namespaces record component.
      Returns:
      the value of the namespaces record component
    • enableReloadFiltering

      public boolean enableReloadFiltering()
      Returns the value of the enableReloadFiltering record component.
      Returns:
      the value of the enableReloadFiltering record component
    • maxWaitForRestart

      public Duration maxWaitForRestart()
      Returns the value of the maxWaitForRestart record component.
      Returns:
      the value of the maxWaitForRestart record component