-
Notifications
You must be signed in to change notification settings - Fork 0
messaging
Benjamin Bennett edited this page Dec 13, 2020
·
15 revisions
This is a simple implementation of message publishing using RabbitMQ and a Go RabbitMQ Client Library.
cd go-bits/messaging
docker-compose up
go run -race main.go

- A connection manager is created and handles:
- Initial connection to RabbitMQ and automated re-connection if the connection is closed.
- Obtaining a server channel (not to be confused with a go channel).
- Connection to RabbitMQ is initiated.
- A queue is configured.
- A message publisher is created.
- Loop is used to publish messages.

Configuration for the connection manager is passed to NewConnManager
and used to set the address for RabbitMQ, the retry interval and the maximum number of retry attempts.