Skip to content

This project demonstrates how to create a simple Java application that produces and consumes user events using Apache Kafka.

Notifications You must be signed in to change notification settings

dwarakcit/java-kafka-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Java Kafka Project

This project demonstrates how to create a simple Java application that produces and consumes user events using Apache Kafka.

Project Structure

java-kafka-project
├── producer
│   ├── src
│   │   ├── main
│   │   │   ├── java
│   │   │   │   └── com
│   │   │   │       └── example
│   │   │   │           └── ProducerApp.java
│   │   │   └── resources
│   │   │       └── application.properties
│   ├── pom.xml
├── consumer
│   ├── src
│   │   ├── main
│   │   │   ├── java
│   │   │   │   └── com
│   │   │   │       └── example
│   │   │   │           └── ConsumerApp.java
│   │   │   └── resources
│   │   │       └── application.properties
│   ├── pom.xml
└── README.md

Prerequisites

  • Java 11 or higher
  • Apache Kafka
  • Maven

Setup Instructions

  1. Clone the repository:

    git clone <repository-url>
    cd java-kafka-project
    
  2. Start Kafka: Follow the instructions in the Kafka documentation to start your Kafka broker.

  3. Configure Producer:

    • Navigate to producer/src/main/resources/application.properties.
    • Update the Kafka broker address and topic name as needed.
  4. Build the Producer:

    cd producer
    mvn clean package
    
  5. Run the Producer:

    java -cp target/producer-1.0-SNAPSHOT.jar com.example.ProducerApp
    
  6. Configure Consumer:

    • Navigate to consumer/src/main/resources/application.properties.
    • Update the Kafka broker address and topic name as needed.
  7. Build the Consumer:

    cd consumer
    mvn clean package
    
  8. Run the Consumer:

    java -cp target/consumer-1.0-SNAPSHOT.jar com.example.ConsumerApp
    

Usage

  • The producer application sends user events to the specified Kafka topic.
  • The consumer application listens to the same topic and processes the received events.

License

This project is licensed under the MIT License.

About

This project demonstrates how to create a simple Java application that produces and consumes user events using Apache Kafka.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages