Example of publisher and consumer of RabbitMQ messages in Golang
The following instructions assume that you have Go correctly installed (and $GOPATH set correctly) and RabbitMQ installed with default settings.
go get github.com/andreagrandi/go-amqp-example
The code will be in $GOPATH/src/github.com/andreagrandi/go-amqp-example
Run the publisher:
cd $GOPATH/src/github.com/andreagrandi/go-amqp-example/publisher
go run publisher.go
Run the consumer:
cd $GOPATH/src/github.com/andreagrandi/go-amqp-example/consumer
go run consumer.go
This source code is inspired by the examples available here http://godoc.org/github.com/streadway/amqp and it's been possible with the help of my co-workers at YoyoWallet.