go-amqp-example
go-amqp-example copied to clipboard
Example of producer and consumer of RabbitMQ messages in Golang
go-amqp-example
Example of publisher and consumer of RabbitMQ messages in Golang
Requirements
The following instructions assume that you have Go correctly installed (and $GOPATH set correctly) and RabbitMQ installed with default settings.
Getting the code
go get github.com/andreagrandi/go-amqp-example
The code will be in $GOPATH/src/github.com/andreagrandi/go-amqp-example
Running the code
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
Credits
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.