- Java 1.8
- Maven 4.0
- Spring BOOT 2.0
- Srping Cloud // FEATURE
- Srping Integration Kafka
- Spring Data JPA
- PostgreSql
- Undertow web server
- Redis // FEATURE
- Lombok
- Mapstruct
- zookeeper - tested on version 3.4.11
- kafka - tested on version 2.12-1.0.0
- postgresql - tested on version 9.6
- create db 'adidas'
- Run zookeeper. From the zookeeper bin folder:
zkserver
- Run kafka broker. From the kafka folder run the command (for windows):
(notes: maybe you need to clean folder "kafka-logs" and "zookeeper-*.data" if broker doesn't start)
.\bin\windows\kafka-server-start.bat .\config\server.properties
- Start modules:
BackOfficeApplication
MidofficeApplication
- In your browser run
http://localhost:8080/route/MAD/LON
It will return shortest route and the one with the less stops
{
"shortestRoute": [
"MAD",
"BCN",
"PAR",
"LON"
],
"lessStopsRoute": [
"MAD",
"VLC",
"LON"
]
}
###4. Get API Documentation (Swagger) Notes: see documentation http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api
- Run target web module
- Open documentation of the module in your browser
Pattern: http://://swagger-ui.html
e.g.:
http://localhost:8082/swagger-ui.html
- Get documentation as JSON
Pattern: http://://v2/api-docs
e.g.:
http://localhost:8082/v2/api-docs
###5. Run in docker TO BE DONE Is done:
- midoffice-app/Dockerfile. To create docker image for midoffice-app run
$ cd to the midoffice directory
$ docker build -f Dockerfile -t book-bus-midoffice-app .
- to run midoffice with kafka in containers use docker compose. Previously change in application.yml localhost -> kafka
$ docker-compose up
as a result zookeeper, kafka and book-bus-midoffice-app should be run, it should say partitiona assigned...
that means that kafka client connected to kafka broker