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 millisecondswarningThresholdMs- the threshold in milliseconds after which a warning is logged. Setting this to a value higher than or equal totimeoutMswill disable warningswarningIntervalMs- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final TaskTimeoutSettingsATaskTimeoutSettingswith all timeouts disabled. -
Constructor Summary
ConstructorsConstructorDescriptionTaskTimeoutSettings(int timeoutMs, int warningThresholdMs, int warningIntervalMs) Creates an instance of aTaskTimeoutSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether these settings are disabled, meaning neither a timeout nor a warning is configured.intReturns the value of thetimeoutMsrecord component.timeoutMs(int timeoutMs) Defines the timeout of the message handler in milliseconds.final StringtoString()Returns a string representation of this record class.intReturns the value of thewarningIntervalMsrecord component.warningIntervalMs(int warningIntervalMs) Defines the interval in milliseconds between warnings.intReturns the value of thewarningThresholdMsrecord component.warningThresholdMs(int warningThresholdMs) Defines the threshold in milliseconds after which a warning is logged.
-
Field Details
-
DISABLED
ATaskTimeoutSettingswith all timeouts disabled.
-
-
Constructor Details
-
TaskTimeoutSettings
public TaskTimeoutSettings(int timeoutMs, int warningThresholdMs, int warningIntervalMs) Creates an instance of aTaskTimeoutSettingsrecord class.- Parameters:
timeoutMs- the value for thetimeoutMsrecord componentwarningThresholdMs- the value for thewarningThresholdMsrecord componentwarningIntervalMs- the value for thewarningIntervalMsrecord component
-
-
Method Details
-
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
Defines the threshold in milliseconds after which a warning is logged.Setting this to a value higher than or equal to
timeoutMswill disable warnings.- Parameters:
warningThresholdMs- the threshold in milliseconds after which a warning is logged- Returns:
- a new settings instance, for fluent interfacing
-
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:
trueif bothtimeoutMs()andwarningThresholdMs()are negative,falseotherwise
-
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. -
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. -
equals
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 '=='. -
timeoutMs
public int timeoutMs()Returns the value of thetimeoutMsrecord component.- Returns:
- the value of the
timeoutMsrecord component
-
warningThresholdMs
public int warningThresholdMs()Returns the value of thewarningThresholdMsrecord component.- Returns:
- the value of the
warningThresholdMsrecord component
-
warningIntervalMs
public int warningIntervalMs()Returns the value of thewarningIntervalMsrecord component.- Returns:
- the value of the
warningIntervalMsrecord component
-