rmq

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Body        []byte
	RoutingKey  string
	Headers     amqp.Table
	DeliveryTag uint64
}

Message contains the most basic about the message

func NewMessage added in v0.5.2

func NewMessage(bytes []byte, xattr map[string]string) *Message

NewMessage will create a new message from a byte slice and attributes

func (*Message) ToXAttrs added in v0.5.2

func (m *Message) ToXAttrs() map[string]string

ToXAttrs takes amqp headers and convert them to attributes

type Override

type Override struct {
	RoutingKey string
}

Override will be used to override RabbitMQ settings on publishing messages

type RabbitMQ

type RabbitMQ struct {
	Wg *sync.WaitGroup
	// contains filtered or unexported fields
}

RabbitMQ type for talking to RabbitMQ

func NewConsumer

func NewConsumer(amqpURI, exchange, queue, routingKey, tag string, prefetch int) *RabbitMQ

NewConsumer creates and sets up a RabbitMQ struct best used for consuming messages

func NewPublisher

func NewPublisher(amqpURI, exchange, queue, tag string, prefetch int) *RabbitMQ

NewPublisher creates and sets up a RabbitMQ Publisher

func (*RabbitMQ) Close added in v0.4.0

func (r *RabbitMQ) Close() error

Close will close the RabbitMQ channel and connection

func (*RabbitMQ) Consume

func (r *RabbitMQ) Consume(out chan Message, verify <-chan Verify)

Consume outputs a stream of Message into a channel from rabbit

func (*RabbitMQ) Publish

func (r *RabbitMQ) Publish(messages chan Message, o Override)

Publish Takes stream of messages and publish them to rabbit

type Verify added in v0.5.0

type Verify struct {
	Tag      uint64
	MultiAck bool
}

Verify will be used to Ack Message from the queue

Jump to

Keyboard shortcuts

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