Backend service that exposes a REST API which allows callers to send push notifications asynchronously. Asynchronously means that service is using queuing service (RabbitMQ) to eventually send the notifications.
-
RabbitMQ:
docker run -d \ -p 5672:5672 -p 15672:15672 \ --hostname rmq --name rmq \ -v "./rmq-data:/var/lib/rabbitmq" \ rabbitmq:3.12-management
-
PostgreSQL:
docker build ./psql -t psql:local
Run the image:
docker run -d \ -p 5432:5432 \ --name psql \ -e "POSTGRES_USER=notif_user" \ -e "POSTGRES_PASSWORD=notif_pass" \ -e "POSTGRES_DB=notification-db" \ -v "./psql-data:/bitnami/postgresql" \ psql:local
-
Spring Boot Application
./mvnw spring-boot:run
Create an external network in docker to expose Spring Boot Application and RabbitMQ management interface.
docker network create frontend
Build docker images and start the docker services.
docker-compose up --build
http://localhost:15672/
http://localhost:8080/swagger-ui/index.html
- Tries to send push notifications to expired (stale) device tokens.
- Fix some known issues
- Expose Websockets/gRPC endpoints
- Note this line in Dockerfile:
It utilizes Docker's RUN cache to cache container's .m2 directory. Basically, it avoids a minuscule change in pom.xml to trigger regeneration of entire .m2 directory. Read more about it on Medium or Dev.to.
RUN \ --mount=type=cache,target=/root/.m2 \ ./mvnw dependency:resolve-plugins dependency:resolve