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 )
Click to show internal directories.
Click to hide internal directories.