This is a Java microservice that manages items from a shop.
To run the application, execute the following command:
mvn spring-boot:run
The application will be accessible at http://localhost:8080.
The API documentation is generated using Swagger. You can access it at http://localhost:8080/swagger-ui.html.
To run the tests, execute the following command:
mvn test
To build a Docker image of the application, first build the application using following command:
mvn -Dmaven.test.skip package
then execute the following command:
docker build -t item-service .
To run the Docker container, execute the following command:
docker run -p 8080:8080 item-service
The application will be accessible at http://localhost:8080.
The RabbitMQ service with the Management Plugin will start as a container named rabbitmq
, and ports 5672 and 15672 will be exposed. You can access the RabbitMQ Management UI at http://localhost:15672
to manage and monitor your RabbitMQ instance.
To start RabbitMQ
docker compose up rabbitmq
To enable message logging in RabbitMQ, follow these steps:
- Access the RabbitMQ Management UI by opening
http://localhost:15672
in a web browser. - Log in with the default credentials (
guest/guest
) or the credentials you specified in thedocker-compose.yaml
file. - Once logged in, navigate to the "Admin" tab and click on the "Logging" link.
- In the "Logging" page, click on the "Add new rule" button.
- Set the following values for the new rule:
- Rule name: Provide a name for the rule (e.g., "Message Logging").
- Log level: Select the desired log level (e.g., "info").
- Log pattern: Set the pattern to
*.*
to log all messages.
- Click on the "Add rule" button to save the new logging rule.
- RabbitMQ will start logging all messages based on the configured rule.
With these changes, RabbitMQ will log every message according to the configured logging rule. You can adjust the log level and pattern as needed to customize the logging behavior.