Microservice responsible to manager books providing endpoints to get a list of books and retrieve a book by Id.
ℹ️ Project to create the book database book-database
Endpoint | Method | Description |
---|---|---|
/v1/books/{id} | GET | Return detail of specified book |
GET /v1/books/1
{
"id": 1,
"title": "The World's First Love: Mary Mother of God",
"isbn": "8987059752",
"languageId": 2,
"numPages": 276,
"publicationDate": "1996-09-01",
"publisherId": 1010
}
Endpoint | Method | Description |
---|---|---|
/v1/books | GET | Return list of books |
GET /v1/books
[
{
"id": 1,
"title": "The World's First Love: Mary Mother of God",
"isbn": "8987059752",
"languageId": 2,
"numPages": 276,
"publicationDate": "1996-09-01",
"publisherId": 1010
},
{
"id": 2,
"title": "The Illuminati",
"isbn": "20049130001",
"languageId": 1,
"numPages": 352,
"publicationDate": "2004-10-04",
"publisherId": 1967
},
{
"id": 3,
"title": "The Servant Leader",
"isbn": "23755004321",
"languageId": 1,
"numPages": 128,
"publicationDate": "2003-03-11",
"publisherId": 1967
}
]
mvn clean install
Execute o comando abaixo para rodar a aplicação.
java -jar ms-book-quarkus-rest-jdbc.jar
to build
docker build -f Dockerfile -t ms-book-quarkus-rest-jdbc:1.0.0 .
to run as a container
docker run -d -p 8080:8080 -i -t ms-book-quarkus-rest-jdbc:1.0.0
build and run containers
docker-compose up --build
stop containers
docker-compose stop
In docker-compose.yml file:
- Books Service : 8080 port is mapped to 8080 port of host
- MySQL : 3306 port is mapped to 3306 port of host
- Prometheus : 9090 port is mapped to 9090 port of host
- Grafana : 3000 port is mapped to 3000 port of host
8080
Attribute | Value |
---|---|
URL | http://localhost:3000 |
Username | admin |
Password | admin |
Port | 3000 |
Attribute | Value |
---|---|
URL | http://localhost:9090 |
Port | 9090 |
- Quarkus 3.0.2
- Java 17
- Prometheus
- Grafana
- MySQL 8