API register vehicle indexed by brand and model with external client app price search.
How works creation:
- Receive request for create Vehicle by POST Rest entrypoint
- Validate database schema constraints, as: UK, Marca and Modelo
- Produce Event for schedule creation
- Consume Event and convert to Object
- Request External Client Demo FIPE getting the vehicle FIPE price
- When has External client Integration Error: send to DLQ
- Convert vehicle Price value to number
- Save vehicle on database
API:
- Java 11: Language Programming version 11
- Spring Boot: Java Injection Framework
- Spring Web: Embedded Web Server (Apache Tomcat)
- Spring JPA: ORM Hibernate
- OpenFeign: Web Client
- RabbitMQ: Async Queue Messaging
- Actuator: Health check
- Flyway: Manage Database Migration Versioning
- Netflix Ribbon: Client Side Load Balancer (Manage OpenFeign Client)
- Jackson ObjectMapper: Library for mapper objects java.
- PostgreSQL: Database SQL
- PostgreSQL Driver: Configure connection with PostgreSQL Database
- Lombok: Java Code Style Improvements
Tests:
- Wiremock: Mock Web client Server
- H2: Light weight Embedded SQL Database
- RestAssured: Testing BDD REST API
- H2 Driver: Configure connection with H2 Database
- JDK Java 11
- Docker / Docker Compose
./gradlew build --parallel --x test
docker build --tag=car-api:latest .
docker-compose up
Example Vehicle Request:
Endpoint: POST /api/v1/veiculos
Payload:
{
"placa": "NEW-4321",
"marcaId": 21,
"modeloId": 473,
"precoAnuncio": 1000000,
"ano": 2011
}
Database Credentials:
System: PosgreSQL
Server: db
Username: 123456789
Password: 123456789
Database: postgres
RabbitMQ Credentials:
Username: guest
Password: guest
Sham Vinicius Fiorin
By Dryve