Skip to content

Yerish26/json-kafka-messenger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisites

Java 17

The project is developed using java 17. It is required to compile the project.

Docker

The project uses docker images for kafka and mysql.
The app is also added to the docker compose for easier testing.
Test containers are also used in integration tests.

Running the app

Compile (with tests)

.\mvnw clean install

Run integration tests

.\mvnw test -Dtest=**/*IT

Compile (without tests)

.\mvnw clean install -DskipTests

Run docker compose (includes building the app image)

docker-compose up --build -d

[NOTE]
Sometimes the app may fail to start if mySQL container is not yet ready.
In that case please start the application image again.

Testing the app

Open kafka producer console

The console producer is used to send messages in JSON format. An example of the JSON object is given below.

docker-compose exec kafka kafka-console-producer --broker-list localhost:9092 --topic test

An example of the JSON object.

{"firstName":"John", "lastName":"Doe"}

A GET API is also added to retrieve saved data from the database

GET http://localhost:8080/users

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published