rabbitmq-tutorials/go
Gabriele Santomaggio 67160290d2
update go version
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
2024-04-17 10:36:29 +02:00
..
.gitignore .gitignore for Go tutorials 2013-10-17 01:10:14 +04:00
emit_log_direct.go Use PublishWithContext instad of Publish (#337) 2022-09-05 11:34:35 +02:00
emit_log_topic.go Use PublishWithContext instad of Publish (#337) 2022-09-05 11:34:35 +02:00
emit_log.go Use PublishWithContext instad of Publish (#337) 2022-09-05 11:34:35 +02:00
go.mod update go version 2024-04-17 10:36:29 +02:00
go.sum update go version 2024-04-17 10:36:29 +02:00
new_task.go Use PublishWithContext instad of Publish (#337) 2022-09-05 11:34:35 +02:00
publisher_confirms.go Use PublishWithContext instad of Publish (#337) 2022-09-05 11:34:35 +02:00
README.md Go: switch to rabbitmq/amqp091-go 2021-06-09 14:58:58 +03:00
receive_logs_direct.go Clarify forever channel declarations 2022-03-09 16:12:15 +01:00
receive_logs_topic.go Clarify forever channel declarations 2022-03-09 16:12:15 +01:00
receive_logs.go Clarify forever channel declarations 2022-03-09 16:12:15 +01:00
receive.go Clarify forever channel declarations 2022-03-09 16:12:15 +01:00
rpc_client.go Use PublishWithContext instad of Publish (#337) 2022-09-05 11:34:35 +02:00
rpc_server.go Use PublishWithContext instad of Publish (#337) 2022-09-05 11:34:35 +02:00
send.go Use PublishWithContext instad of Publish (#337) 2022-09-05 11:34:35 +02:00
worker.go Clarify forever channel declarations 2022-03-09 16:12:15 +01:00

Go code for RabbitMQ tutorials

Here you can find Go code examples from RabbitMQ tutorials.

Requirements

These examples use the rabbitmq/amqp091-go client library. Get it first with

go get github.com/rabbitmq/amqp091-go

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 rabbitmq/amqp091-go.