OutboxItem

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

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

OutboxItem
Link copied to clipboard
fun OutboxItem(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)

Functions

prepareForProcessing
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.

Properties

deleteAfter
Link copied to clipboard
var deleteAfter: Instant? = null
groupId
Link copied to clipboard
val groupId: String? = null
id
Link copied to clipboard
val id: Long? = null
lastExecution
Link copied to clipboard
var lastExecution: Instant? = null
markedForProcessing
Link copied to clipboard
var markedForProcessing: Boolean = false

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.

nextRun
Link copied to clipboard
var nextRun: Instant
payload
Link copied to clipboard
val payload: String
rerunAfter
Link copied to clipboard
var rerunAfter: Instant? = null
retries
Link copied to clipboard
var retries: Long = 0
status
Link copied to clipboard
var status: OutboxStatus
type
Link copied to clipboard
val type: OutboxType