SA project stub
Report Bug
·
Request Feature
Contents
This is the lab project for the SA course at the UOC. It is made up of 3 elements (each one in its own GIT repository):
- A docker-compose.yml file to startup the basic infrastructure needed to run the services
- A folder for the ShowCatalog microservice
- A folder for the Notification microservice
(go up)
(go up)
To set up the containers that are part of the basic infrastructure of the project, the following ports will be used:
- 22181 - Apache Kafka (Zookeeper)
- 19092, 29092 - Apache Kafka (Server)
- 54320 - PostgreSQL
- 18080 - Adminer
- 18081 - Used by the showcatalog microservice
- 18082 - Used by the notification microservice
To avoid conflicts with other installed applications, the default ports of all applications have been modified. Still, if there is a conflict over a port already in use, simply modifying the ports specified in the docker-compose.yml file will fix the problem. This link to the official docker compose documentation explains how to modify this configuration using the ports: Networking in Compose option. IMPORTANT NOTICE: The modified ports will also have to be changed in the microservices configuration (usually defined in the Spring application.properties file).
Proceed to install Docker Compose following the steps described in the following guide: https://docs.docker.com/compose/install/ (according to your OS).
Under Windows, registration may be required, as Docker Desktop requires it for educational/personal/non-commercial projects. On the plus side, it will not be necessary to install anything else because it already includes Compose.
It is important that you carefully review the hardware and software requirements described in the installation guides. Docker can run on two different backends and each one has different requirements. If your system can't meet them, you will see errors when trying to start containers even after a successful installation. An alternative for those with slightly older systems is Docker Toolbox.
Once Docker Compose is installed, we will continue with the project stub. It is recommended to set up a folder structure like so:
epcsd-spring-main
├ README.md
├ docker-compose.yml
├ epcsd-spring-notification-main
└ epcsd-spring-showcatalog-main
(go up)
-
Download the code in ZIP format or just clone the epcsd-spring repository in the working folder (epcsd-spring-main if the recommendation has been followed).
-
From the work folder, run the command:
docker compose up (Win)
docker-compose up (Linux)
The following containers should start:
- epcsd-spring_adminer_1 - adminer, an SQL client
- epcsd-spring_kafka_1 - the kafka server
- epcsd-spring_db_1 - the postgresql database
- epcsd-spring_zookeeper_1 - kafka zookeeper
In order to verify that all containers are up and running, we will execute the following command:
docker ps -a
We should see something like this:
To check the operation, you can access the Adminer panel at http://localhost:18080/ and make a query against the PostgreSQL DB that we have just instantiated with the following connection data:
- Engine: PostgreSQL
- Server: db
- User: epcsd
- Password: epcsd
- Schema: epcsd
- Download the code in ZIP format or just clone the epcsd-spring-showcatalog and epcsd-spring-notification repositories into the working folder (epcsd-spring-main if the recommendation has been followed)
- Open the projects in the preferred development environment
- Verify proper build and run by starting the projects and checking that http://localhost:18081/swagger-ui/index.html and http://localhost:18082/swagger-ui/index.html are accessible
(go up)
- Docker / Docker Compose
- Spring / Spring Boot
- Apache Kafka
- PostgreSQL
- Lombok
- springdoc-openapi-ui (SwaggerUI for OpenApi 3)
Pau Pineda - ppineda0@uoc.edu
(go up)