Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConnectionString = "amqp://guest:guest@localhost:5672"
Functions ¶
This section is empty.
Types ¶
type IRabbitMQMessagingClient ¶
type IRabbitMQMessagingClient interface { PublishOnQueue(ctx context.Context, body []byte, exchange string) error SubscribeToQueue(consumerExchangeName string, handlerFunc func(amqp.Delivery) error) error Close() }
IMessagingClient defines an interface for connection and consuming messages
type QueueDetails ¶
type Queues ¶
type Queues struct { QueueDetails []QueueDetails Exchanges []Exchange }
func InitiateQueues ¶
InitiateQueues takes as input a queue to exchange mapping an returns reference to a queue
type RabbitMQClient ¶
type RabbitMQClient struct { Conn *amqp.Connection Chann *amqp.Channel Logger *zap.Logger QueueBindings map[string]*amqp.Queue }
func New ¶
New creates an amqp broker connection and binds a set of input queues to each specific exchange Note all queues that the services writes to and consumes must be present and passed as input parameters
func (*RabbitMQClient) Close ¶
func (m *RabbitMQClient) Close()
Close closes the connection to the AMQP-broker, if available.
func (*RabbitMQClient) PublishOnQueue ¶
PublishOnQueue publishes a message on a queue based on exchange name
func (*RabbitMQClient) SubscribeToQueue ¶
func (m *RabbitMQClient) SubscribeToQueue(consumerExchangeName string, callback func(amqp.Delivery) error) error
SubscribeToQueue subscribes a callback to a queue tied to an exchange
Click to show internal directories.
Click to hide internal directories.