Class OutboxEntryEntity

java.lang.Object
org.keycloak.models.jpa.entities.OutboxEntryEntity

@Entity public class OutboxEntryEntity extends Object
Generic durable outbox row: a single message persisted for asynchronous, at-least-once delivery by a feature-scoped drainer.

Backed by the OUTBOX_ENTRY table created in META-INF/jpa-changelog-26.7.0.xml. Multiple subsystems (SSF, webhooks, ...) share this table; the entryKind discriminator scopes every read and write so cross-consumer contention is eliminated by the (ENTRY_KIND, ...) compound indexes rather than by separate tables.

Two-axis classification on every row:

  • entryKind — the broad subsystem ("ssf", "webhook", ...).
  • entryType — the concrete type within that subsystem (for SSF the SET event_type; for webhooks the hook event name; etc.).

Scoping columns:

  • ownerId — primary scoping key (clientId for SSF receivers, hookId for webhooks). Drives per-owner stats / delete / cleanup endpoints.
  • containerId — optional sub-grouping within (entryKind, ownerId) (the receiver's stream id for SSF). Lets stream-scoped lifecycle operations stay SQL-filterable rather than hidden in metadata.

The wire shape of the payload (signed JWS, JSON, opaque blob) and the contents of the optional metadata JSON are owned by the subsystem's OutboxDeliveryHandler — the entity treats both as opaque text.

  • Field Details

    • id

      protected String id
    • entryKind

      protected String entryKind
    • realmId

      protected String realmId
    • ownerId

      protected String ownerId
    • containerId

      protected String containerId
      Optional sub-grouping within (entryKind, ownerId). For SSF this is the receiver's stream id so operations such as "narrow events_requested for stream X" or "stream X disabled — purge its undelivered rows" stay SQL-filterable rather than hidden in metadata. Kinds that don't need a sub-group leave it null.
    • correlationId

      protected String correlationId
    • entryType

      protected String entryType
    • payload

      protected String payload
    • metadata

      protected String metadata
    • status

      protected OutboxEntryStatus status
    • attempts

      protected int attempts
    • nextAttemptAt

      protected Instant nextAttemptAt
    • lastError

      protected String lastError
    • createdAt

      protected Instant createdAt
    • deliveredAt

      protected Instant deliveredAt
  • Constructor Details

    • OutboxEntryEntity

      public OutboxEntryEntity()
  • Method Details

    • getId

      public String getId()
    • setId

      public void setId(String id)
    • getEntryKind

      public String getEntryKind()
    • setEntryKind

      public void setEntryKind(String entryKind)
    • getRealmId

      public String getRealmId()
    • setRealmId

      public void setRealmId(String realmId)
    • getOwnerId

      public String getOwnerId()
    • setOwnerId

      public void setOwnerId(String ownerId)
    • getContainerId

      public String getContainerId()
    • setContainerId

      public void setContainerId(String containerId)
    • getCorrelationId

      public String getCorrelationId()
    • setCorrelationId

      public void setCorrelationId(String correlationId)
    • getEntryType

      public String getEntryType()
    • setEntryType

      public void setEntryType(String entryType)
    • getPayload

      public String getPayload()
    • setPayload

      public void setPayload(String payload)
    • getMetadata

      public String getMetadata()
    • setMetadata

      public void setMetadata(String metadata)
    • getStatus

      public OutboxEntryStatus getStatus()
    • setStatus

      public void setStatus(OutboxEntryStatus status)
    • getAttempts

      public int getAttempts()
    • setAttempts

      public void setAttempts(int attempts)
    • getNextAttemptAt

      public Instant getNextAttemptAt()
    • setNextAttemptAt

      public void setNextAttemptAt(Instant nextAttemptAt)
    • getLastError

      public String getLastError()
    • setLastError

      public void setLastError(String lastError)
    • getCreatedAt

      public Instant getCreatedAt()
    • setCreatedAt

      public void setCreatedAt(Instant createdAt)
    • getDeliveredAt

      public Instant getDeliveredAt()
    • setDeliveredAt

      public void setDeliveredAt(Instant deliveredAt)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object