Options

data class Options(val queue: String, val prefetch: Int = 250, val vt: Duration = 10.seconds, val autoStart: Boolean = true, val enableNotifyInsert: Boolean = false, val queueMinPullDelay: Duration = 50.milliseconds, val queueMaxPullDelay: Duration = 2.seconds, val messageRetryDelayStep: Duration = 500.milliseconds, val messageMaxRetryDelay: Duration = 60.seconds)(source)

Configuration options for a message queue consumer.

Throws

Thrown if any of the validation conditions for the properties are violated: - queue must not be empty or blank. - prefetch must be greater than 0. - vt duration must be at least 1 second. - queueMinPullDelay and queueMaxPullDelay must be positive, and queueMinPullDelay must be less than queueMaxPullDelay. - messageRetryDelayStep and messageMaxRetryDelay must be positive, and messageRetryDelayStep must be less than messageMaxRetryDelay.

Constructors

Link copied to clipboard
constructor(queue: String, prefetch: Int = 250, vt: Duration = 10.seconds, autoStart: Boolean = true, enableNotifyInsert: Boolean = false, queueMinPullDelay: Duration = 50.milliseconds, queueMaxPullDelay: Duration = 2.seconds, messageRetryDelayStep: Duration = 500.milliseconds, messageMaxRetryDelay: Duration = 60.seconds)

Properties

Link copied to clipboard

Indicates if the consumer should automatically start processing messages. Defaults to true.

Link copied to clipboard

Determines whether insertion notifications are enabled for the queue. Defaults to false.

Link copied to clipboard

The channel used for listening to insertion notifications. Derived from the queue name and formatted as "pgmq.q_.INSERT".

Link copied to clipboard

The maximum retry delay for a message. Must be positive. Defaults to 60 seconds.

Link copied to clipboard

The incremental delay applied before retrying a message. Must be positive and less than messageMaxRetryDelay. Defaults to 500 milliseconds.

Link copied to clipboard

The maximum number of messages to prefetch at a time. Must be greater than 0. Defaults to 250.

Link copied to clipboard

The name of the queue. Must be non-empty and non-blank.

Link copied to clipboard

The maximum delay between consecutive pull operations from the queue. Must be positive and greater than queueMinPullDelay. Defaults to 2 seconds.

Link copied to clipboard

The minimum delay between consecutive pull operations from the queue. Must be positive and less than queueMaxPullDelay. Defaults to 50 milliseconds.

Link copied to clipboard

The visibility timeout duration for a message. Specifies the period after which a message becomes visible for processing again if it has not been acknowledged. Must be at least 1 second. Defaults to 10 seconds.

Link copied to clipboard

A derived value calculated as vt * 2. Represents an adjusted visibility timeout bias.