ISCSD project stub
Report Bug
·
Request Feature
Contents
This is the lab project for the ISCSD 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 ProductCatalog microservice
- A folder for the User 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 - Apache Kafka (Server)
- 54320, 54321 - PostgreSQL
- 18080 - Adminer
- 18081 - Used by the productcatalog microservice
- 18082 - Used by the user 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. If your system fails to meet them, even after a successful installation, you will see errors when trying to start containers. 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:
spring-2024
├ README.md
├ docker-compose.yml
├ spring-2024-notification
├ spring-2024-productcatalog
└ spring-2024-user
(go up)
-
Download the code in ZIP format or just clone the spring-2024 repository in the working folder (spring-2024 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:
- spring-2024-adminer_1 - adminer, an SQL client
- spring-2024-kafka_1 - the kafka server
- spring-2024-productdb_1 - the postgresql database for the productcatalog service
- spring-2024-userdb_1 - the postgresql database for the user service
- spring-2024-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:
- productdb
- Engine: PostgreSQL
- Server: productdb
- User: product
- Password: product
- Schema: product
- userdb
- Engine: PostgreSQL
- Server: userdb
- User: user
- Password: user
- Schema: user
- Download the code in ZIP format or just clone the spring-2024-productcatalog, spring-2024-user and spring-2024-notification repositories into the working folder (spring-2024 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)
Vicenç Font - [email protected]