Skip to content

A practice area of using golang with messsage brokers

License

Notifications You must be signed in to change notification settings

escalopa/gobrokers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gobrokers

A practice area of using golang with messsage brokers

RabbitMQ Exampel 🐰

In this example we creaete a group to which many consumers can subscribe to. The consumers will receive messages from the group and process them.

So the message that is being published is received by all the consumers that are subscribed to the group, Which is the case in a group chat

Setup 🔨

  1. Run rabbitmq server with docker compose
docker compose -f rabbitMQ/docker-compose.yml up

Run 🚀

  1. Run the publisher 📦
go run rabbitMQ/prod/main.go
  1. Run the consumer 🍹

You can run multiple consumers by changing the queueName in the cli arg, Currently the queueName is set to my-queue0 & my-queue1, But u can make more edits to the rabbitMQ/prod/main.go file to create more queues

go run rabbitMQ/consumer/main.go -queueName="my-queue0"

About

A practice area of using golang with messsage brokers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages