Java Spring Boot with Kafka example project for TechEule.com
All provided paths in this file are relative to the root-folder of this git-repository.
At TechEule.com you can find more info about this repository.
The Avro-Schemas are located at:
src/main/resources/avro-schemas/
Note
First, you have to compile this project using maven because the
AVRO
-classes are generated from the AVRO-Schema atsrc/main/resources/avro-schemas
using the org.apache.avro :: avro-maven-plugin
- JDK version 17 or newer
- Maven 3.8 or newer
- Docker
- Docker Compose
Open the terminal
# navigate to environment/te-spring-kafka-docker
cd environment/te-spring-kafka-docker
# start the docker compose services
# the first time it will take several minutes to pull all needed docker images
docker-compose up -d
After the environment is booted you have to run the database migration. This project support both database systems MySQL and Postgresql, but not at the same time.
mvn -Dflyway.configFiles=src/main/flyway/flyway-mysql.properties flyway:migrate
mvn -Dflyway.configFiles=src/main/flyway/flyway-postgresql.properties flyway:migrate
Here you have to decide which database system do you want to use.
mvn clean package --activate-profiles mysql,-postgresql
mvn clean package --activate-profiles -mysql,postgresql
Here you have to decide which database system do you want to use.
mvn clean spring-boot:run --activate-profiles mysql,-postgresql -Dspring-boot.run.profiles=mysql
java -Dspring.profiles.active="mysql" -jar target/techeule-java-maven-template.jar
mvn clean spring-boot:run --activate-profiles -mysql,postgresql -Dspring-boot.run.profiles=postgresql
java -Dspring.profiles.active="postgresql" -jar target/techeule-java-maven-template.jar