BaseProcessedEvent

@MappedSuperclass
abstract class BaseProcessedEvent(var id: Long? = null, var eventId: String, var consumerGroup: String, var processedAt: Instant = Instant.now()) : ProcessedEvent(source)

JPA @MappedSuperclass providing the column mapping for a row in the per-service processed_event table used by the consumer-side idempotent receiver pattern.

Concrete per-service entities extend this class with their own @Entity

  • @Table(name = "processed_event") annotations. The uniqueness of (event_id, consumer_group) is enforced by a UNIQUE constraint in the Flyway migration; the constraint violation is the signal that a duplicate was received.

Constructors

Link copied to clipboard
constructor(id: Long? = null, eventId: String, consumerGroup: String, processedAt: Instant = Instant.now())

Properties

Link copied to clipboard
open override var consumerGroup: String

Kafka consumer group that processed the event (one row per (eventId, consumerGroup)).

Link copied to clipboard
open override var eventId: String

Inbound eventId Kafka header value being marked as processed.

Link copied to clipboard
open override var id: Long?

Storage-assigned surrogate id; null until the row is first persisted.

Link copied to clipboard
open override var processedAt: Instant

Instant the row was inserted, i.e. when processing completed.