Package org.keycloak.models.jpa.entities
Class OutboxEntryEntity
java.lang.Object
org.keycloak.models.jpa.entities.OutboxEntryEntity
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 inmetadata.
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 Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected StringOptional sub-grouping within(entryKind, ownerId).protected Stringprotected Instantprotected Instantprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Instantprotected Stringprotected Stringprotected Stringprotected OutboxEntryStatus -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetId()inthashCode()voidsetAttempts(int attempts) voidsetContainerId(String containerId) voidsetCorrelationId(String correlationId) voidsetCreatedAt(Instant createdAt) voidsetDeliveredAt(Instant deliveredAt) voidsetEntryKind(String entryKind) voidsetEntryType(String entryType) voidvoidsetLastError(String lastError) voidsetMetadata(String metadata) voidsetNextAttemptAt(Instant nextAttemptAt) voidsetOwnerId(String ownerId) voidsetPayload(String payload) voidsetRealmId(String realmId) voidsetStatus(OutboxEntryStatus status)
-
Field Details
-
id
-
entryKind
-
realmId
-
ownerId
-
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 inmetadata. Kinds that don't need a sub-group leave it null. -
correlationId
-
entryType
-
payload
-
metadata
-
status
-
attempts
protected int attempts -
nextAttemptAt
-
lastError
-
createdAt
-
deliveredAt
-
-
Constructor Details
-
OutboxEntryEntity
public OutboxEntryEntity()
-
-
Method Details
-
getId
-
setId
-
getEntryKind
-
setEntryKind
-
getRealmId
-
setRealmId
-
getOwnerId
-
setOwnerId
-
getContainerId
-
setContainerId
-
getCorrelationId
-
setCorrelationId
-
getEntryType
-
setEntryType
-
getPayload
-
setPayload
-
getMetadata
-
setMetadata
-
getStatus
-
setStatus
-
getAttempts
public int getAttempts() -
setAttempts
public void setAttempts(int attempts) -
getNextAttemptAt
-
setNextAttemptAt
-
getLastError
-
setLastError
-
getCreatedAt
-
setCreatedAt
-
getDeliveredAt
-
setDeliveredAt
-
equals
-
hashCode
public int hashCode()
-