rabbitmq-tutorials/go
2015-08-10 09:41:11 +01:00
..
.gitignore .gitignore for Go tutorials 2013-10-17 01:10:14 +04:00
emit_log_direct.go Improved, fixed bug, and cleaned up code for Go. 2014-08-18 21:29:50 -04:00
emit_log_topic.go Improved, fixed bug, and cleaned up code for Go. 2014-08-18 21:29:50 -04:00
emit_log.go Changed emit_log.go to handle multiple command line args 2014-10-26 18:35:00 -04:00
new_task.go declare queue and log message sent 2015-08-10 09:41:11 +01:00
README.md Corrected execute statements to have topic arguments 2014-10-26 19:51:21 -04:00
receive_logs_direct.go Added check to verify that sufficient args are supplied. 2014-10-26 19:28:15 -04:00
receive_logs_topic.go Corrected argument handling 2014-10-26 19:52:02 -04:00
receive_logs.go Changed emit_log.go to handle multiple command line args 2014-10-26 18:35:00 -04:00
receive.go Improved, fixed bug, and cleaned up code for Go. 2014-08-18 21:29:50 -04:00
rpc_client.go Added Tutorial 6 code for Go. 2014-08-18 21:29:22 -04:00
rpc_server.go Added Tutorial 6 code for Go. 2014-08-18 21:29:22 -04:00
send.go Update send.go 2015-08-04 12:16:53 +04:30
worker.go Imports corrected 2014-10-26 18:08:57 -04:00

Go code for RabbitMQ tutorials

Here you can find Go code examples from RabbitMQ tutorials.

Requirements

To run this code you need Go RabbitMQ client:

go get github.com/streadway/amqp

Code

Code examples are executed via go run:

Tutorial one: "Hello World!":

go run send.go
go run receive.go

Tutorial two: Work Queues:

go run new_task.go hello world
go run worker.go

Tutorial three: Publish/Subscribe

go run receive_logs.go
go run emit_log.go hello world

Tutorial four: Routing

go run receive_logs_direct.go info warn
go run emit_log_direct.go warn "a warning"

Tutorial five: Topics

go run receive_logs_topic.go "kern.*" "*.critical"
go run emit_log_topic.go kern.critical "A critical kernel error"

Tutorial six: RPC

go run rpc_server.go
go run rpc_client.go 10

To learn more, see Go RabbitMQ client.