amqp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddService

func AddService(config service.Config)

func Start

func Start()

func Stop

func Stop() error

Types

type Publisher added in v0.1.4

type Publisher struct {
	amqp.Publishing

	Exchange string
	Queue    string
	Type     string
	Data     interface{}
}

func (Publisher) Publish added in v0.1.4

func (p Publisher) Publish() error

Publish will push data onto the queue

type Session added in v0.0.64

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

This exports a Session object that wraps this library. It automatically reconnects when the connection fails, and blocks all pushes until the connection succeeds. It also confirms every outgoing message, so none are lost. It doesn't automatically ack each message, but leaves that to the parent process, since it is usage-dependent.

Try running this in one terminal, and `rabbitmq-server` in another. Stop & restart RabbitMQ to see how the queue reacts.

func NewSession added in v0.0.64

func NewSession() *Session

New creates a new consumer state instance, and automatically attempts to connect to the server.

func (*Session) Close added in v0.0.64

func (session *Session) Close() error

Close will cleanly shutdown the channel and connection.

func (*Session) Stream added in v0.0.64

func (session *Session) Stream() error

Stream will continuously put queue items on the channel. It is required to call delivery.Ack when it has been successfully processed, or delivery.Nack when it fails. Ignoring this will cause data to build up on the server.

Jump to

Keyboard shortcuts

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