Documentation ¶
Index ¶
Constants ¶
const (
COMPRESS_HEADER = "compress"
)
Variables ¶
var DefaultQueueOptions = QueueOptions{ Durable: true, Delete: false, Exclusive: false, }
DefaultQueueOptions define the default options when creating queues: durable, not autodelete and not exclusive
Functions ¶
This section is empty.
Types ¶
type AMQPConsumer ¶
type AMQPConsumer interface { Receive(exchange string, routingKeys []string, queue string, queueOptions QueueOptions, queueTimeout time.Duration) chan AmqpMessage ReceiveWithoutTimeout(exchange string, routingKeys []string, queue string, queueOptions QueueOptions) chan AmqpMessage }
AMQPConsumer represents an AMQP consumer. Used to receive messages with or without timeout
type AMQPPublisher ¶
type AMQPPublisher interface { Publish(string, []byte, ...map[string]interface{}) PublishWithTTL(string, []byte, int, ...map[string]interface{}) }
AMQPPublisher represents an AMQP Publisher that can publish messages with or without TTL
type AmqpConsumer ¶
type AmqpConsumer struct {
// contains filtered or unexported fields
}
AmqpConsumer holds the brokerURI
func NewAmqpConsumer ¶
func NewAmqpConsumer(brokerURI string) *AmqpConsumer
NewAmqpConsumer returns an AMQP Consumer
func (*AmqpConsumer) Receive ¶
func (client *AmqpConsumer) Receive(exchange string, routingKeys []string, queue string, queueOptions QueueOptions, queueTimeout time.Duration) chan AmqpMessage
Receive Return a AmqpMessage channel to receive messages using a given queue connected to the exchange with one ore more routing keys Autoreconnect on error or when we have no message after queueTimeout expired. Use 0 when not timeout is required. The function declares the queue
func (*AmqpConsumer) ReceiveWithoutTimeout ¶
func (client *AmqpConsumer) ReceiveWithoutTimeout(exchange string, routingKeys []string, queue string, queueOptions QueueOptions) chan AmqpMessage
ReceiveWithoutTimeout the same behavior that Receive method, but without using a timeout for receiving from the queue
type AmqpMessage ¶
AmqpMessage struct
type AmqpPublisher ¶
type AmqpPublisher struct {
// contains filtered or unexported fields
}
AmqpPublisher holds the brokerURI, exchange name and channel where to submit messages to be publish to rabbitmq
func NewAmqpPublisher ¶
func NewAmqpPublisher(brokerURI, exchange string) *AmqpPublisher
NewAmqpPublisher returns an AmqpPublisher
func (*AmqpPublisher) Publish ¶
func (publisher *AmqpPublisher) Publish(routingKey string, message []byte, headers ...map[string]interface{})
Publish publish a message using the given routing key
func (*AmqpPublisher) PublishWithTTL ¶
func (publisher *AmqpPublisher) PublishWithTTL(routingKey string, message []byte, ttl int, headers ...map[string]interface{})
PublishWithTTL publish a message waiting the given TTL
type QueueOptions ¶
QueueOptions holds the flags when declaring a queue: durable, delete, exclusive