rabbitmq

package
v0.0.0-...-7d43bac Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package rabbitmq provides support for RabbitMQ message broker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageBroker

type MessageBroker struct {
	Connection *amqp.Connection // amqp connection
}

MessageBroker represents message broker based on RabbitMQ.

func NewMessageBroker

func NewMessageBroker(address string, opts ...cb.Option) *MessageBroker

NewMessageBroker creates instance of RabbitMQ message broker which is connected on provided address. Additional options passed as arguments are used to configure circuit breaker pattern to connect to RabbitMQ instance. Panics if cannot create an instance.

func (*MessageBroker) Dispose

func (b *MessageBroker) Dispose()

Dispose closes RabbitMQ connection.

func (MessageBroker) PublishMessage

func (b MessageBroker) PublishMessage(ctx context.Context, m broker.Message) error

PublishMessage publishes message to RabbitMQ instance.

func (MessageBroker) Subscribe

func (b MessageBroker) Subscribe(ctx context.Context, topic string) (<-chan broker.Message, error)

Subscribe subscribes to specified routing key/topic in RabbitMQ instance.

Jump to

Keyboard shortcuts

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