Git Product home page Git Product logo

java-sample-service's Introduction

Item Service

This is a Java microservice that manages items from a shop.

Running the Application

To run the application, execute the following command:

mvn spring-boot:run

The application will be accessible at http://localhost:8080.

API Documentation

The API documentation is generated using Swagger. You can access it at http://localhost:8080/swagger-ui.html.

Testing

To run the tests, execute the following command:

mvn test

Docker

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.

RabbitMQ Configuration

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:

  1. Access the RabbitMQ Management UI by opening http://localhost:15672 in a web browser.
  2. Log in with the default credentials (guest/guest) or the credentials you specified in the docker-compose.yaml file.
  3. Once logged in, navigate to the "Admin" tab and click on the "Logging" link.
  4. In the "Logging" page, click on the "Add new rule" button.
  5. 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.
  6. Click on the "Add rule" button to save the new logging rule.
  7. 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.

java-sample-service's People

Watchers

Krystian avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.