Skip to content

Files

Latest commit

6716029 · Apr 17, 2024

History

History

go

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 16, 2013
Jun 9, 2021
Sep 5, 2022
Sep 5, 2022
Sep 5, 2022
Apr 17, 2024
Apr 17, 2024
Sep 5, 2022
Sep 5, 2022
Mar 9, 2022
Mar 9, 2022
Mar 9, 2022
Mar 9, 2022
Sep 5, 2022
Sep 5, 2022
Sep 5, 2022
Mar 9, 2022

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.