Hello-Kafka is a simple application that receives requests from /api/v1/message
and publishes them to a Kafka topic. It also has an active listener that listens to the published topic and prints the message to the console.
Before you can run this application, you'll need to have the following installed:
- Java (version 17 or higher)
- Apache Kafka (version 2.12 or higher)
To get started with Hello-Kafka, follow these steps:
- Clone this repository to your local machine.
- Configure the Kafka topic, producer, and consumer settings in the
application.properties
file. - Build the project using Maven:
mvn clean package
- Run the application using the Spring Boot Maven plugin:
mvn spring-boot:run
- Send a POST request to
localhost:8080/api/v1/message
with a message in the request body. - Check the console to see the message that was received by the Kafka listener.
The following configuration files are available in the project:
KafkaTopicConfig.java
: Configures the Kafka topic settings.KafkaProducerConfig.java
: Configures the Kafka producer settings.KafkaConsumerConfig.java
: Configures the Kafka consumer settings.
If you'd like to contribute to Hello-Kafka, please follow these guidelines:
- Fork this repository.
- Create a new branch for your changes.
- Make your changes and commit them to your branch.
- Push your branch to your forked repository.
- Create a pull request from your branch to this repository's
README.md
file.
We appreciate your contributions and will review your pull request as soon as possible!
Hello-Kafka is released under the MIT License. See LICENSE
file for details.