queue

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package queue adds a topology.Declarer interface able to describe AMQP queues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoDelete

func AutoDelete(queue *Declarer)

AutoDelete will automatically delete the described queue if there are no more consumers subscribed to the queue.

func Durable

func Durable(queue *Declarer)

Durable will make the described queue survive AMQP broker restarts.

func Exclusive

func Exclusive(queue *Declarer)

Exclusive will make the described queue be usable by only one AMQP connection and it will be deleted when such connection gets closed.

func NoWait

func NoWait(queue *Declarer)

NoWait does not wait for the AMQP broker to confirm if queue declaration has succeeded, but the AMQP channel will instead assume the queue has been declared successfully.

Types

type Declarer

type Declarer struct {
	// contains filtered or unexported fields
}

Declarer is a topology component able to declare AMQP queues. Use Declare function to create a new instance of this component.

func Declare

func Declare(name string, options ...Option) Declarer

Declare returns a new Declarer component able to declare the described AMQP queue.

func (Declarer) Declare

func (d Declarer) Declare(ch topology.Channel) error

Declare declares the topology of the queue using the supplied AMQP channel.

type Option

type Option func(*Declarer)

Option is an optional functionality that can be added to the Declarer that is being initialized by the Declare factory method.

func Arguments

func Arguments(args amqp.Table) Option

Arguments specifies optional arguments to be supplied during queue declaration. Multiple calls of this option are supported.

func BindTo

func BindTo(exchange, routingKey string) Option

BindTo describes a binding for the queue. Multiple calls of this option are supported.

func DeadLetter

func DeadLetter(exchange, routingKey string) Option

DeadLetter adds Dead Letter Exchange functionality to the described queue, by publishing rejected messages on the exchange and routingKey provided.

func DeadLetterWithQueue

func DeadLetterWithQueue(exchange, routingKey string, dlq Declarer) Option

DeadLetterWithQueue declares a Dead Letter Exchange and a queue that will be binded to the specified exchange and routing key.

Useful to persist failed messages in a specified queue and consuming messages from such queue from the application with a compensating action.

func Description

func Description(desc string) Option

Description adds a description for the queue.

Jump to

Keyboard shortcuts

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