Google Pub/Sub is an asynchronous messages service, or maybe you can call it as message broker like RabbitMQ / Kafka
in this project I made 2 different cli applications, one of which acts as a message publisher, application that sends messages on the topic, the other one as a subscriber, application that subscribing messages from a topic.
- Make sure that you already have go on you pc
- You must have google projects that enable google pubsub Api.
- You must create at least 1 topic and 1 subscription on google pubsub api.
- Save the name of your google project on
.env
file asGOOGLE_PROJECT_ID
- Change your working directory to the publisher.
cd publisher
- Install any go module on this app
go get
- Run this publisher app
go run main.go
- Change your working directory to the subscriber.
cd subscriber
- Install any go module on this app
go get
- Run this subscriber app
go run main.go