Demo application working with Pub/Sub, based on the Yokai Go framework.
This demo application is a simple subscriber to Pub/Sub.
It provides:
- a Yokai application container, with the worker module to offer a worker subscribing to Pub/Sub (using the fxgcppubsub contrib module)
- a Pub/Sub emulator container, with preconfigured topic and subscription
- a Pub/Sub emulator UI container, preconfigured to work with the emulator container
- a Jaeger container to collect the application traces
This demo application is following the recommended project layout:
cmd/
: entry pointsconfigs/
: configuration filesinternal/
:worker/
: workersbootstrap.go
: bootstrapregister.go
: dependencies registration
This demo application provides a Makefile
:
make up # start the docker compose stack
make down # stop the docker compose stack
make logs # stream the docker compose stack logs
make fresh # refresh the docker compose stack
make test # run tests
make lint # run linter
To start the application, simply run:
make fresh
After a short moment, the application will offer:
- http://localhost:8081: application core dashboard
- http://localhost:8680: pub/sub emulator UI
- http://localhost:16686: jaeger UI
You can use the Pub/Sub emulator UI to publish a message to the preconfigured topic:
http://localhost:8680/project/demo-project/topic/demo-topic
Check your application logs by running:
make logs
You will see the SubscribeWorker subscribed to Pub/Sub in action, logging the received messages.