go

command module
v0.0.0-...-64d6a9b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 3 Imported by: 0

README

RabbitMQ logo

your RabbitMQ connection deserves a name: Go edition

An example on how to assign a name to a RabbitMQ connection in Go.

Get it running

  1. Start the RabbitMQ docker container:
$ docker run --rm \
    --publish 15672:15672 \
    --publish 5672:5672 \
    --name ycdan-rabbitmq \
    --detach \
    rabbitmq:3-management
  1. Compile the example program:
$ go build -o your-connection-deserves-a-name
  1. Start the example program:
$ ./your-connection-deserves-a-name

You should see something like

2021/07/30 19:45:37 Connecting to RabbitMQ on amqp://guest:guest@127.0.0.1:5672/
2021/07/30 19:45:37 Connecting to RabbitMQ on amqp://guest:guest@127.0.0.1:5672/ ... Successful
2021/07/30 19:45:37
2021/07/30 19:45:37 Keeping the connection open ...
2021/07/30 19:45:37 You can connect to the RabbitMQ management UI: http://127.0.0.1:15672/#/connections (Username: guest, Password: guest)
2021/07/30 19:45:37 	-> Check the Connections Tab and see the Connection Name
2021/07/30 19:45:37 Hit CTRL + C or cancel the process to stop.
2021/07/30 19:45:37
  1. Visit the RabbitMQ Management UI at http://127.0.0.1:15672/#/connections (Username: guest, Password: guest) and confirm the connection name.

Don't know what this is all about?

Read the original blog post your database connection deserves a name @ andygrunwald.com.

Additionally, you can check out the projects README.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL