OutboxItem

data class OutboxItem(    val id: Long? = null,     val type: OutboxType,     var status: OutboxStatus,     val payload: String,     var retries: Long = 0,     var nextRun: Instant,     var lastExecution: Instant? = null,     var rerunAfter: Instant? = null,     var deleteAfter: Instant? = null,     val groupId: String? = null)

Represents an outbox item.

Parameters

groupId

an arbitrary value that can be used to group outbox items together. A null value indicates that the item is not part of a group.

Constructors

Link copied to clipboard
constructor(    id: Long? = null,     type: OutboxType,     status: OutboxStatus,     payload: String,     retries: Long = 0,     nextRun: Instant,     lastExecution: Instant? = null,     rerunAfter: Instant? = null,     deleteAfter: Instant? = null,     groupId: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val groupId: String? = null
Link copied to clipboard
val id: Long? = null
Link copied to clipboard
Link copied to clipboard

is an internal flag that is used to determine if the item should be processed in the current monitor cycle. It is set by prepareForProcessing based on the item status and current time. Clients could (and should) ignore the value. Even if set earlier, its value be reset during the monitor cycle.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun prepareForProcessing(now: Instant, rerunAfter: Instant)

Resolves whether the item is eligible for processing based on its state (i.e. status, timestamps, etc.) and the current time (supplied as a parameter). If the item is eligible for processing, it is marked as such and its status and run timestamps are updated accordingly.