Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQPPayload ¶
AMQPPayload represents a single message to be published to an AMQP queue
type BrokerConfig ¶
type BrokerConfig struct { Host string VHost string Port string User string Password string ConsumerName string ExchangeName string ConnectionTimeout string }
BrokerConfig contains the fundamental configuration values required to connect to an AMQP host.
type Consumer ¶
Consumer refers to a connection to an AMQP instance that reads messages.
func NewConsumer ¶
func NewConsumer(broker BrokerConfig, exchangeType string, queueName string, bindingKeys []string) *Consumer
NewConsumer creates a new, initialized instance of an AMQP message consumer using the configuration information supplied in config. New incoming AMQP messages are sent to the handler function provided.
func (*Consumer) SetAutoDelete ¶ added in v1.2.0
SetAutoDelete marks the queue so that RabbitMQ will automatically delete the queue when the client disconnects.
func (*Consumer) SetDurable ¶ added in v1.2.0
SetDurable marks the queue to determine if the values stored in the queue will persist across restarts
func (*Consumer) SetExclusive ¶ added in v1.2.0
func (*Consumer) SetObserver ¶ added in v1.0.2
func (c *Consumer) SetObserver(obs MessageProcessor)
SetObserver provides a function to be called whenever a message is received from AMQP
func (*Consumer) SetQueueTTL ¶ added in v1.2.1
SetQueueTTL sets the time to live for the queue in milliseconds
type IConsumer ¶ added in v1.0.2
type IConsumer interface { // Start instructs the consumer to begin listening for and consuming inforation from AMQP Start() // SetObserver provides a function that will be called every time the consumer receives a new message SetObserver(obs MessageProcessor) }
Consumer is an interface specification that defines the operations that can be performed on an AMQP consumer. The basic consumer consists of a goroutine that actively retrieves messages from AMQP and an observer function that is called for every message retrieved.
type MessageProcessor ¶
MessageProcessor is a type of function that is called whenever a message is received from an AMQP queue.
type Payload ¶ added in v1.0.1
type Payload struct { ContentType string ContentEncoding string CorrelationId string Timestamp time.Time AppId string Exchange string RoutingKey string Headers amqp.Table Body []byte }
Payload represents the contents of a message retrieved from an AMQP queue.
type Producer ¶
Producer represents a user that produces messages to be published to an AMQP queue.
func NewProducer ¶
func NewProducer(broker BrokerConfig, config ProducerConfig) *Producer
NewProducer creates a new, initialized instance of AMQPPublsher
func (*Producer) IsConnected ¶
IsConnected returns true if the publisher is connected to an AMQP instance and false otherwise
type ProducerConfig ¶
type ProducerConfig struct { Source string ExchangeName string ExchangeType string PublishingChannel chan AMQPPayload }
ProducerConfig is configuration that is specific to outgoing connections to an AMQP host