Record Class JpaTokenStoreConfiguration
java.lang.Object
java.lang.Record
org.axonframework.messaging.eventhandling.processing.streaming.token.store.jpa.JpaTokenStoreConfiguration
- Record Components:
loadingLockMode- The lock mode to use when retrieving tokens from the underlying store.claimTimeout- A timeout specifying the time after which this process will force a claim.nodeId- The id as aStringto identify ownership of the tokens.
public record JpaTokenStoreConfiguration(@Nonnull jakarta.persistence.LockModeType loadingLockMode, @Nonnull TemporalAmount claimTimeout, @Nonnull String nodeId)
extends Record
Configuration for the
JpaTokenStore.
Can be used to modify the JpaTokenStore's settings.
- Since:
- 5.0.0
- Author:
- Jens Mayer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic JpaTokenStoreConfigurationAJpaTokenStoreConfigurationinstance with the following default values: TheloadingLockModedefaults toLockModeType.PESSIMISTIC_WRITETheclaimTimeoutdefaults to 10 seconds ThenodeIddefaults to the name of the managed bean for the runtime system of the Java virtual machine -
Constructor Summary
ConstructorsConstructorDescriptionJpaTokenStoreConfiguration(jakarta.persistence.LockModeType loadingLockMode, TemporalAmount claimTimeout, String nodeId) Compact constructor validating that the givennodeIdis non-empty and non-null. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclaimTimeoutrecord component.claimTimeout(TemporalAmount claimTimeout) Sets theclaimTimeoutspecifying the amount of time a process will wait after which this process will force a claim of aTrackingToken.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.jakarta.persistence.LockModeTypeReturns the value of theloadingLockModerecord component.loadingLockMode(jakarta.persistence.LockModeType loadingLockMode) TheLockModeTypeto use when loading tokens from the underlying database.nodeId()Returns the value of thenodeIdrecord component.Sets thenodeIdto identify ownership of the tokens.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
AJpaTokenStoreConfigurationinstance with the following default values:- The
loadingLockModedefaults toLockModeType.PESSIMISTIC_WRITE - The
claimTimeoutdefaults to 10 seconds - The
nodeIddefaults to the name of the managed bean for the runtime system of the Java virtual machine
- The
-
-
Constructor Details
-
JpaTokenStoreConfiguration
public JpaTokenStoreConfiguration(@Nonnull jakarta.persistence.LockModeType loadingLockMode, @Nonnull TemporalAmount claimTimeout, @Nonnull String nodeId) Compact constructor validating that the givennodeIdis non-empty and non-null.
-
-
Method Details
-
loadingLockMode
TheLockModeTypeto use when loading tokens from the underlying database.Defaults to
LockModeType.PESSIMISTIC_WRITE, to force a write lock, which prevents lock upgrading and potential resulting deadlocks.- Parameters:
loadingLockMode- The lock mode to use when retrieving tokens from the underlying store.- Returns:
- The configuration itself, for fluent API usage.
-
claimTimeout
Sets theclaimTimeoutspecifying the amount of time a process will wait after which this process will force a claim of aTrackingToken.Thus, if a claim has not been updated for the given
claimTimeout, this process will 'steal' the claim. Defaults to a duration of 10 seconds.- Parameters:
claimTimeout- A timeout specifying the time after which this process will force a claim.- Returns:
- The configuration itself, for fluent API usage.
-
nodeId
Sets thenodeIdto identify ownership of the tokens.Defaults to the name of the managed bean for the runtime system of the Java virtual machine.
- Parameters:
nodeId- The id as aStringto identify ownership of the tokens.- Returns:
- The configuration itself, for fluent API usage.
-
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 withObjects::equals(Object,Object). -
loadingLockMode
@Nonnull public jakarta.persistence.LockModeType loadingLockMode()Returns the value of theloadingLockModerecord component.- Returns:
- the value of the
loadingLockModerecord component
-
claimTimeout
Returns the value of theclaimTimeoutrecord component.- Returns:
- the value of the
claimTimeoutrecord component
-
nodeId
Returns the value of thenodeIdrecord component.- Returns:
- the value of the
nodeIdrecord component
-