amqpinterfaces

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: AGPL-3.0 Imports: 1 Imported by: 2

Documentation

Overview

Package amqpinterfaces contains the interfaces for the AMQP service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPServiceInterface

type AMQPServiceInterface interface {
	Messages() <-chan amqp.Delivery
	InitProducerAMQP()
	InitConsumerAMQP()
	PublishMessage(exchangeName string, topic string, message map[string]interface{}, headers *amqp.Table)
	// TryPublishMessage is PublishMessage but reports publish failures.
	TryPublishMessage(exchangeName string, topic string, message map[string]interface{}, headers *amqp.Table) error
	// RunConsumer blocks forever: it (re)connects the consumer with backoff and
	// dispatches each delivery to handler, settling it per the returned outcome.
	RunConsumer(handler func(*amqp.Delivery) MessageOutcome)
}

AMQPServiceInterface defines the interface for AMQP operations

type MessageOutcome

type MessageOutcome int

MessageOutcome tells the delivery loop how to settle a message.

const (
	// OutcomeAck acknowledges the message (successful processing).
	OutcomeAck MessageOutcome = iota
	// OutcomeDrop nacks without requeue (permanent failure / poison message).
	OutcomeDrop
	// OutcomeRequeue retries later (transient failure): the message is
	// republished to a delay queue and redelivered after an exponential backoff,
	// not immediately. After a configurable number of retries (default 10) it is
	// parked in a dead-letter queue instead. Tuned per worker via the
	// <W>_AMQP_CONSUMER_ env vars REQUEUE_BASE_DELAY_MILLIS,
	// REQUEUE_MAX_DELAY_MILLIS, REQUEUE_MAX_RETRIES and
	// REQUEUE_DEAD_LETTER_TTL_MILLIS.
	OutcomeRequeue
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL