Package-level declarations

Types

Link copied to clipboard
data class Message(val msgId: Long, val readCt: Int, val enqueuedAt: Instant, val vt: Instant, val message: String, val headers: Map<String, String>)

Represents a message in a queue system.

Link copied to clipboard
data class Metrics(val queueName: String, val queueLength: Long, val newestMsgAgeSec: Int, val oldestMsgAgeSec: Int, val totalMessages: Long, val scrapeTime: Instant, val queueVisibleLength: Long)

Represents the metrics of a message queue at a specific point in time.

Link copied to clipboard
class PgMqClient(val pg: PgMqDbAdapter, options: PgMqClient.Options = Options())

PgMqClient is a client for interfacing with the pgmq system, providing various messaging queue operations. This client makes use of PostgreSQL as a message queue backend.

Link copied to clipboard
class PgMqConsumer(pgmq: PgMqClient, options: PgMqConsumer.Options, onMessage: suspend (Message) -> Unit, onFaiToRead: suspend (Throwable) -> Unit = {}, onFailToProcess: suspend (Throwable) -> Unit = {}, onFaiToAck: suspend (Throwable) -> Unit = {}, onFaiToNack: suspend (Throwable) -> Unit = {})

PgMqConsumer is responsible for consuming messages from a PostgreSQL-based message queue (PgMq). It provides configurable options for queue management and handles message processing, acknowledging, and retrying logic.

Link copied to clipboard

Adapter interface for interacting with PostgreSQL's message queue feature.

Link copied to clipboard
data class QueueRecord(val name: String, val partitioned: Boolean, val unlogged: Boolean, val createdAt: Instant)

Represents a record of a queue in the system, which holds metadata about the queue's configuration and creation time.