This project uses Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
- Hexagonal Architecture
- Unit Test:
mvn test
- Integration Test:
mvn verify -DskipITs=false
- Error Handler
- Authentication - 401
- Authorization - 403
- Business Error - 400 - code: x
- Generic Error - 500
- Em dev e test, retornar o stacktrace, em prod NÃO
- Validation Error - 400 - code: 1
- NotFound - 404
- API RestFull API
- Compressão de HTTP
- Authorization with RBAC: Não é o objetivo garantir a autenticação, somente a authorizacao. Configuração no docker compose, após, importar o arquivo
realm-export.json
contido na raiz do projeto. Para gerar o token, deve criar um usuario e atribuir as roles contidas no clientquarkus-camel
. A autenticação deve ser efetuada através doquarkus-camel-frontend
. - Hibernate with Panache, Envers
- Flyway: Em dev e test o flyway é executado normalmente ao iniciar a aplicação. Em Prd, dentro do cluster k8s é necessario utilizar um
initContainer
e invocar a aplicação passando o parametroflyway:migrate
. - Healthcheck ( Database, APIs, Thrird Party e Application) - K8S
- Camel
- Log
- Splunk
- New Relic - Micrometer?!
- Docker com Native Build
- CI
- CD
- Open API
- HAL Form
- Reactive API (https://quarkus.io/blog/mutiny-pagination/)
Pendente:
- Teste de Integração com o Keycloak (https://quarkus.io/guides/security-openid-connect#integration-testing-keycloak-devservices)
- Autenticacao Camel com teste
It's a todo system using Red Hat Quarkus and Apache Camel.
Features:
- Save a Todo task
- List a Todo Task
- Complete a Todo Task
- Delete a Todo Task
- When a Task is created, completed or deleted, the app notify the log system
- When a Task is created, completed or deleted, the app send an email
- When a Task is completed or deleted, the app create an audit report to this action
- Authetication with keycloak for example.
- To Create, Delete or completed, need authenticated, but, to list, don't need.
- In list method I can pass a filter, to list just my tasks
- Detail all audit about one todo task
Table: Task
Field | Data type |
---|---|
id | pk(uuid) |
ownerId | uuid |
title | varchar(64) |
description | varchar(256) |
completedAt | nullable(timestamp) |
createdAt | timestamp |
deletedAt | nullable(timestamp) |
Table: Audit
Field | Data type |
---|---|
id | pk(id) |
userId | uuid |
taskId | uuid |
auditedAt | timestamp |
beforeStatus | nullable(CREATED or COMPLETED or DELETED) |
afterStatus | nullable(CREATED or COMPLETED or DELETED) |
You can run your application in dev mode that enables live coding using:
./mvnw compile quarkus:dev
NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
The application can be packaged using:
./mvnw package
It produces the quarkus-run.jar
file in the target/quarkus-app/
directory.
Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/
directory.
The application is now runnable using java -jar target/quarkus-app/quarkus-run.jar
.
If you want to build an über-jar, execute the following command:
./mvnw package -Dquarkus.package.type=uber-jar
The application, packaged as an über-jar, is now runnable using java -jar target/*-runner.jar
.
You can create a native executable using:
./mvnw package -Pnative
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
./mvnw package -Pnative -Dquarkus.native.container-build=true
You can then execute your native executable with: ./target/quarkus-camel-1.0.0-SNAPSHOT-runner
If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.
Easily start your Reactive RESTful Web Services