Documentation
¶
Overview ¶
Package amqputils contains the AMQP consumer utils
Package amqputils contains the AMQP producer utils ¶
Package amqputils contains the AMQP utils
Index ¶
- Variables
- func AreConsumerChannelsReady() bool
- func CloseConsumerConnection()
- func CloseProducerConnection()
- func GetConsumerConnectionStatus() map[string]interface{}
- func InitConsumerAMQP(workerName string)
- func InitProducerAMQP(workerName string)
- func IsConsumerConnectionHealthy() bool
- func IsProducerConnectionHealthy() bool
- func PublishMessage(exchangeName string, topic string, message map[string]interface{}, ...)
- func RunConsumer(workerName string, handler func(*amqp.Delivery) amqpinterfaces.MessageOutcome)
- func TryPublishMessage(exchangeName string, topic string, message map[string]interface{}, ...) error
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidConfig = errors.New("amqp consumer configuration is incomplete")
ErrInvalidConfig marks a configuration failure that retrying cannot fix. It is deliberately fatal: see the panic in InitConsumerAMQP.
var Messages <-chan amqp.Delivery
Messages is the channel for the AMQP messages
Functions ¶
func AreConsumerChannelsReady ¶
func AreConsumerChannelsReady() bool
AreConsumerChannelsReady checks if the consumer channels are ready to receive messages
func CloseConsumerConnection ¶
func CloseConsumerConnection()
CloseConsumerConnection closes the consumer AMQP connection
func CloseProducerConnection ¶
func CloseProducerConnection()
CloseProducerConnection closes the producer AMQP connection
func GetConsumerConnectionStatus ¶
func GetConsumerConnectionStatus() map[string]interface{}
GetConsumerConnectionStatus returns the status of the consumer connection for debugging
func InitConsumerAMQP ¶
func InitConsumerAMQP(workerName string)
InitConsumerAMQP initializes the AMQP consumer
func InitProducerAMQP ¶
func InitProducerAMQP(workerName string)
InitProducerAMQP initializes the AMQP producer
func IsConsumerConnectionHealthy ¶
func IsConsumerConnectionHealthy() bool
IsConsumerConnectionHealthy checks if the consumer AMQP connection is healthy
func IsProducerConnectionHealthy ¶
func IsProducerConnectionHealthy() bool
IsProducerConnectionHealthy checks if the producer AMQP connection is healthy
func PublishMessage ¶
func PublishMessage(exchangeName string, topic string, message map[string]interface{}, headers *amqp.Table)
PublishMessage publishes a message to the AMQP broker, logging (not returning) any failure
func RunConsumer ¶
func RunConsumer(workerName string, handler func(*amqp.Delivery) amqpinterfaces.MessageOutcome)
func TryPublishMessage ¶
func TryPublishMessage(exchangeName string, topic string, message map[string]interface{}, headers *amqp.Table) error
TryPublishMessage publishes a message to the AMQP broker and reports failures. A nil error means the message was handed to the channel (no publisher confirms).
Types ¶
This section is empty.