Record Class TaskTimeoutSettings

java.lang.Object
java.lang.Record
org.axonframework.messaging.core.timeout.TaskTimeoutSettings
Record Components:
timeoutMs - the timeout of the message handler in milliseconds
warningThresholdMs - the threshold in milliseconds after which a warning is logged. Setting this to a value higher than or equal to timeoutMs will disable warnings
warningIntervalMs - the interval in milliseconds between warnings

public record TaskTimeoutSettings(int timeoutMs, int warningThresholdMs, int warningIntervalMs) extends Record
Configuration properties for a task timeout.

Used in other parts of the configuration. For a fully disabled configuration, use the DISABLED constant.

Since:
4.11.0
Author:
Mitchell Herrijgers, Steven van Beelen
  • Field Details

    • DISABLED

      public static final TaskTimeoutSettings DISABLED
      A TaskTimeoutSettings with all timeouts disabled.
  • Constructor Details

    • TaskTimeoutSettings

      public TaskTimeoutSettings(int timeoutMs, int warningThresholdMs, int warningIntervalMs)
      Creates an instance of a TaskTimeoutSettings record class.
      Parameters:
      timeoutMs - the value for the timeoutMs record component
      warningThresholdMs - the value for the warningThresholdMs record component
      warningIntervalMs - the value for the warningIntervalMs record component
  • Method Details

    • timeoutMs

      public TaskTimeoutSettings timeoutMs(int timeoutMs)
      Defines the timeout of the message handler in milliseconds.
      Parameters:
      timeoutMs - the timeout of the message handler in milliseconds
      Returns:
      a new settings instance, for fluent interfacing
    • warningThresholdMs

      public TaskTimeoutSettings warningThresholdMs(int warningThresholdMs)
      Defines the threshold in milliseconds after which a warning is logged.

      Setting this to a value higher than or equal to timeoutMs will disable warnings.

      Parameters:
      warningThresholdMs - the threshold in milliseconds after which a warning is logged
      Returns:
      a new settings instance, for fluent interfacing
    • warningIntervalMs

      public TaskTimeoutSettings warningIntervalMs(int warningIntervalMs)
      Defines the interval in milliseconds between warnings.
      Parameters:
      warningIntervalMs - the interval in milliseconds between warnings
      Returns:
      a new settings instance, for fluent interfacing
    • isDisabled

      public boolean isDisabled()
      Returns whether these settings are disabled, meaning neither a timeout nor a warning is configured.
      Returns:
      true if both timeoutMs() and warningThresholdMs() are negative, false otherwise
    • 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. All components in this record class are compared with '=='.
      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.
    • timeoutMs

      public int timeoutMs()
      Returns the value of the timeoutMs record component.
      Returns:
      the value of the timeoutMs record component
    • warningThresholdMs

      public int warningThresholdMs()
      Returns the value of the warningThresholdMs record component.
      Returns:
      the value of the warningThresholdMs record component
    • warningIntervalMs

      public int warningIntervalMs()
      Returns the value of the warningIntervalMs record component.
      Returns:
      the value of the warningIntervalMs record component