This is a batch brocessing demo used for processing chunks of data from a kafka broker or a relational database and writing them in chunks in a CSV file and can be restarted if any error occurs inside the batch processing
- Java 21
- Maven
- Kafka
- Zookeeper
- DB (Any database that is supported inside JDBC)
- Docker (Optionally but recommended to have to just use the instances without having to install it yourself)
NOTE: there is a docker-compose.yaml
file for both kafka ,zookeeper and postgres that are used in this demo you can just use docker-compose up -d
then you would have Kafka, Zookeeper and a PostgreSQL database isntances running
- Clone the repository
git clone https://github.com/ittovate/batch-processing.git
- Navigate to the project directory
cd batch-processing
- Run the following command to start Kafka,Zookeeper and PostgreSQL instances
This command will start new instances but if you already ran it before you could use
docker-compose up -d
Note : Make sure that the instances are up and running usingdocker-compose start
If there is an instance not running correctly run it again usingdocker ps
rundocker start {spring_batch_postgres_db} OR {spring-batch-zookeeper-demo} OR {spring-batch-kafka-demo}
docker start
then append the name of either of the above 3 names if any of them is not shown when usingdocker ps
- Build and run the project
mvn clean install spring-boot:run