Base Outbox
JPA @MappedSuperclass providing the column mapping for a Kafka outbox row.
Concrete per-service entities (e.g. OutboxJpaEntity in iam/mail/template) extend this class with their own @Entity + @Table(name = "kafka_outbox") annotations. The base class implements the persistence-agnostic OutboxMessage contract: mutable fields use var with protected set so that Hibernate dirty-tracking can emit partial UPDATE statements while still exposing an effectively-immutable API to callers via behavior methods (DDD rich aggregate).
Mongo/Cassandra adapters can implement these methods by returning a fresh copy of the document instead. The processor never observes the difference.
Constructors
Properties
Latest publishing error message, or null if the message has never failed.
Instant of the most recent retry; used together with veds.outbox.retry-cooldown to throttle redelivery.
Instant of the most recent dispatch attempt (success or failure).
Number of publishing attempts already made. Compared against veds.outbox.max-retries.
Current lifecycle OutboxStatus. See the enum's KDoc for the state machine.
Functions
Marks the message as successfully published to the broker. Sets status to OutboxStatus.COMPLETED and stamps processedAt with the current instant.
Transitions the message to OutboxStatus.DEAD_LETTERED. Terminal — the message will never be retried automatically.
Marks the message as being currently processed. Sets status to OutboxStatus.PROCESSING and stamps processedAt with the current instant.
Reverts the message to OutboxStatus.PENDING after a failed publishing attempt, incrementing retryCount and stamping lastRetryAt. The message will be picked up again by the next poller cycle after the configured retry cooldown elapses.