rabbitmq

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeadLetterQueue string

Functions

func DeclareExchanges

func DeclareExchanges(exchanges []string, kind string, durable bool, autoDelete bool, internal bool, noWait bool, table amqp.Table) error

func DeclareQueues

func DeclareQueues(queues []string, durable bool, autoDelete bool, exclusive bool, noWait bool, table amqp.Table) error

func Listen

func Listen(listenMap map[string]GenericFN, prefetch int)

func ProcessDeadLetter

func ProcessDeadLetter(payload []byte) error

func PublishToExchange

func PublishToExchange(exchangeName string, data interface{}) error

func PublishToQueue

func PublishToQueue(queueName string, data interface{}) error

func SetDeadLetterQueue

func SetDeadLetterQueue(queueName string)

Types

type Channel

type Channel struct {
	*amqp.Channel
	// contains filtered or unexported fields
}

Channel amqp.Channel wapper

func Connect

func Connect(url string) *Channel

func GetChannel

func GetChannel() *Channel

func (*Channel) Close

func (ch *Channel) Close() error

Close ensure closed flag set

func (*Channel) Consume

func (ch *Channel) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)

Consume wrap amqp.Channel.Consume, the returned delivery will end only when channel closed by developer

func (*Channel) IsClosed

func (ch *Channel) IsClosed() bool

IsClosed indicate closed by developer

type Connection

type Connection struct {
	*amqp.Connection
}

Connection amqp.Connection wrapper

func Dial

func Dial(url string) (*Connection, error)

Dial wrap amqp.Dial, dial and get a reconnect connection

func DialCluster

func DialCluster(urls []string) (*Connection, error)

DialCluster with reconnect

func GetConnection

func GetConnection() *Connection

func (*Connection) Channel

func (c *Connection) Channel() (*Channel, error)

Channel wrap amqp.Connection.Channel, get a auto reconnect channel

type GenericFN

type GenericFN func([]byte) error

Jump to

Keyboard shortcuts

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