This example provides a Rest API using Spring Boot with HTTP methods like POST, GET, DELETE and PUT.
- SpringBoot 1.5.3
- MySQL
- JPA
- Hibernate
- Kafka
First, build the application
./mvnw clean install -e
Next, launch the services using Docker...
Landoop Kafka Development Environment
docker run -d \ --restart=always \ --name=kafka \ -p 2181:2181 -p 3030:3030 -p 8081:8081 \ -p 8082:8082 -p 8083:8083 -p 9092:9092 \ -e ADV_HOST=127.0.0.1 \ landoop/fast-data-dev:latest
Mariadb
docker run -d \ --restart=always \ --name mariadb \ -p 3306:3306 \ -v /storage/mariadb:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=root \ mariadb:latest
PhpAdmin (Optional)
docker run --name myadmin -d \ --restart=always \ --link mariadb:db \ -p 8181:80 \ phpmyadmin/phpmyadmin
Spring Boot Configuration | Class or Java property files |
---|---|
The Main Class | EmployeeApplication |
Properties Files | application.properties |
- SpringBoot
- Database
- Spring Rest Docs
- Kafka
- JWT
Running Kafka CLI
docker run --rm -it --net=host landoop/fast-data-dev bash
Creating a topic
kafk-topics --zookeeper 127.0.0.1:2181 --create --topic employee --partition 3 --replication-factor 1
Find more in Landoop Documentation