The Catalog microservice is responsible for maintaining a list of products, each with a name, description, and price. It was developed as part of a course project on creating microservices using RabbitMQ for communication between services.
- Programming Language: Java with Spring Boot
- Database: MongoDB
- Message Queue: RabbitMQ
- Containerization: Docker
- Clone the GitHub repository:
git clone git@github.com:RedbeanGit/polyshop-catalog.git-
Install Docker and Docker Compose on your machine if you haven't already. You can follow the installation instructions on Docker's official website: https://docs.docker.com/get-docker/ and https://docs.docker.com/compose/install/.
-
Navigate to the Catalog microservice directory:
cd polyshop-catalog- Launch Docker Compose to start the necessary containers:
docker-compose up -dNow you can choose to run the Catalog service inside a docker container or directly on your host.
- Build the Docker image for the microservice using the provided Dockerfile:
docker build -t polyshop-catalog .- Run the container from the image you have just builded:
docker run --name polyshop_catalog polyshop-catalog- Start Spring Boot application:
./mvnw spring-boot:runList of routes/API endpoints available for this microservice:
- GET /products : Retrieves the list of all products in the catalog.
- GET /products/{productId} : Retrieves a product with the specified ID.
- POST /products : Creates a new product.
The Catalog microservice listens for all messages coming from the Order microservice (order-exchange) using the routing key order.checked in order to update its own list of products.