This microservice is responsible for consuming messages from queue and processing subscription operations. Microservice is splitted into two part: HTTP-server and message consumer.
OpenAPI - https://str1kez.github.io/SportiqSubscriptionService
Message handler is based on Rabbit MQ, has N
parallel workers on goroutines. Variable can be set in .env
.
History is stored in PostgreSQL, subscription data is stored in ReJSON module with RediSearch support. This allows to improve the speed of working on frequently changing data.
You can execute only one command to startup the microservice:
docker compose up -d --remove-orphans --build
Or do it manually:
- Create
.env
file and fill it:make env
- Make migrations
- Build Docker-image:
make build-image-handler
- Check Start on HTTP-server
The server allows the user to interact with the microservice. It runs on gin framework with parallel workers.
You can execute only one command to startup the microservice:
docker compose up -d --remove-orphans --build
Or do it manually:
- Create
.env
file and fill it (if didn't do it on message handler step):make env
- Make migrations (if didn't do it on message handler step)
- Build Docker-image:
make build-image-server
- Start the microservice:
make up
Need to install migrate
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
After that you must run migrations with fullfilled .env.dev
file
- Create a reserve queue for unprocessed messages
- Improve code architecture (more separated layers)