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 ¶
- func CloseRes()
- func CreateConsumeNamedQueue(name string, ch *amqp.Channel) (*amqp.Queue, <-chan amqp.Delivery, error)
- func CreateConsumeTempQueue(ch *amqp.Channel) (*amqp.Queue, <-chan amqp.Delivery, error)
- func PublishCommand(q *amqp.Channel, id string, prefix string, command string, ...) error
- type Connection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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