Record Class SagaConfig

java.lang.Object
java.lang.Record
org.j7m.middleware.saga.SagaConfig
Record Components:
eventLogDirectory - directory for durable saga event log state
messagingDirectory - directory for durable outbox and inbox state
clock - service clock used for deterministic timeout and retry evaluation
maxActiveSagas - maximum number of non-terminal saga executions
maxStepsPerSaga - maximum steps allowed in one definition
maxRetryAttempts - maximum retry attempts allowed by policies
maxPendingOutboxCommands - maximum pending durable outbox commands
maxCommandPayloadBytes - maximum command payload size accepted at start
maxEvidenceEntries - maximum evidence records retained in public status
maxDeadLettersInStatus - maximum dead-letter records exposed in public status
maxCheckpointBytes - maximum canonical checkpoint body bytes accepted for write and recovery

public record SagaConfig(Path eventLogDirectory, Path messagingDirectory, Clock clock, int maxActiveSagas, int maxStepsPerSaga, int maxRetryAttempts, int maxPendingOutboxCommands, int maxCommandPayloadBytes, int maxEvidenceEntries, int maxDeadLettersInStatus, int maxCheckpointBytes) extends Record
Configuration for a local durable saga service.

The configuration owns local durable-log and messaging directories and enforces bounded resource use. Paths are local filesystem paths; the service does not use an external workflow engine or transaction coordinator.

  • Constructor Details

    • SagaConfig

      public SagaConfig(Path eventLogDirectory, Path messagingDirectory, Clock clock, int maxActiveSagas, int maxStepsPerSaga, int maxRetryAttempts, int maxPendingOutboxCommands, int maxCommandPayloadBytes, int maxEvidenceEntries, int maxDeadLettersInStatus, int maxCheckpointBytes)
      Creates a validated configuration.
    • SagaConfig

      public SagaConfig(Path eventLogDirectory, Path messagingDirectory, Clock clock, int maxActiveSagas, int maxStepsPerSaga, int maxRetryAttempts, int maxPendingOutboxCommands, int maxCommandPayloadBytes, int maxEvidenceEntries, int maxDeadLettersInStatus)
      Creates a validated configuration using the default checkpoint byte limit.
      Parameters:
      eventLogDirectory - directory for durable saga event log state
      messagingDirectory - directory for durable outbox and inbox state
      clock - service clock used for deterministic timeout and retry evaluation
      maxActiveSagas - maximum number of non-terminal saga executions
      maxStepsPerSaga - maximum steps allowed in one definition
      maxRetryAttempts - maximum retry attempts allowed by policies
      maxPendingOutboxCommands - maximum pending durable outbox commands
      maxCommandPayloadBytes - maximum command payload size accepted at start
      maxEvidenceEntries - maximum evidence records retained in public status
      maxDeadLettersInStatus - maximum dead-letter records exposed in public status
  • Method Details

    • defaults

      public static SagaConfig defaults(Path directory)
      Creates a local default configuration.
      Parameters:
      directory - root directory for service state
      Returns:
      validated default configuration rooted below directory
    • 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.
    • eventLogDirectory

      public Path eventLogDirectory()
      Returns the value of the eventLogDirectory record component.
      Returns:
      the value of the eventLogDirectory record component
    • messagingDirectory

      public Path messagingDirectory()
      Returns the value of the messagingDirectory record component.
      Returns:
      the value of the messagingDirectory record component
    • clock

      public Clock clock()
      Returns the value of the clock record component.
      Returns:
      the value of the clock record component
    • maxActiveSagas

      public int maxActiveSagas()
      Returns the value of the maxActiveSagas record component.
      Returns:
      the value of the maxActiveSagas record component
    • maxStepsPerSaga

      public int maxStepsPerSaga()
      Returns the value of the maxStepsPerSaga record component.
      Returns:
      the value of the maxStepsPerSaga record component
    • maxRetryAttempts

      public int maxRetryAttempts()
      Returns the value of the maxRetryAttempts record component.
      Returns:
      the value of the maxRetryAttempts record component
    • maxPendingOutboxCommands

      public int maxPendingOutboxCommands()
      Returns the value of the maxPendingOutboxCommands record component.
      Returns:
      the value of the maxPendingOutboxCommands record component
    • maxCommandPayloadBytes

      public int maxCommandPayloadBytes()
      Returns the value of the maxCommandPayloadBytes record component.
      Returns:
      the value of the maxCommandPayloadBytes record component
    • maxEvidenceEntries

      public int maxEvidenceEntries()
      Returns the value of the maxEvidenceEntries record component.
      Returns:
      the value of the maxEvidenceEntries record component
    • maxDeadLettersInStatus

      public int maxDeadLettersInStatus()
      Returns the value of the maxDeadLettersInStatus record component.
      Returns:
      the value of the maxDeadLettersInStatus record component
    • maxCheckpointBytes

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