mqwrapper

package
v0.0.0-...-725c2af Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MPL-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package mqwrapper provides functions to create and utilize the MQ system as the BOLT engine requires. This includes default settings on Queues, Channels, etc. Tests require a server available at amqp://guest:guest@localhost:5672

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseRes

func CloseRes()

CloseRes trying to close res in workerStub

func CreateConsumeNamedQueue

func CreateConsumeNamedQueue(name string, ch *amqp.Channel) (*amqp.Queue, <-chan amqp.Delivery, error)

CreateConsumeNamedQueue uses an open channel to create a durable named queue Returns the queue, the consume channel, and an error if either fails to create

func CreateConsumeTempQueue

func CreateConsumeTempQueue(ch *amqp.Channel) (*amqp.Queue, <-chan amqp.Delivery, error)

CreateConsumeTempQueue uses an open channel to create a temp queue for a command Returns the queue, the consume channel, and an error if either fails to create

func PublishCommand

func PublishCommand(q *amqp.Channel, id string, prefix string, command string, payload *gabs.Container, replyTo string) error

PublishCommand pushes a processing command up to the MQ with its uuid, command name, and payload The replyTo should normally be set to the queue.Name created via CreateConsumeTempQueue

Types

type Connection

type Connection struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel
}

Connection holds amqp connection info

func ConnectMQ

func ConnectMQ(amqpURL string) (*Connection, error)

ConnectMQ connects to supplied RabbitMQ or other amqp url. Be sure to defer the .Close() calls on both the connection and channel Returns the Connection and an open Channel

func (*Connection) Close

func (c *Connection) Close()

Close closes the channel and connection

Jump to

Keyboard shortcuts

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