Skip to content

anushka530/KafkaProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


# KafkaProject

A lightweight, distributed messaging application built with Java and Apache Kafka, featuring decoupled event production and consumption through two independent microservices.

## πŸ—οΈ Architecture

* **ProducerService**: Publishes events/messages to a designated Apache Kafka topic.
* **ConsumerService**: Subscribes to the Kafka topic and processes incoming messages in real-time.

---

## πŸ› οΈ Prerequisites

* **Java JDK 17+**
* **Apache Maven**
* **Apache Kafka** (running locally or via Docker)

---

## πŸš€ Quick Start

### 1. Start Kafka Broker
If you use Docker, spin up Kafka quickly:
```yaml
version: '3'
services:
  zookeeper:
    image: confluentinc/cp-zookeeper:latest
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
  kafka:
    image: confluentinc/cp-kafka:latest
    depends_on: [zookeeper]
    ports:
      - "9092:9092"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1

2. Run the Applications

Open two separate terminals and execute the following commands:

Start Producer

cd ProducerService
mvn clean install && mvn spring-boot:run

Start Consumer

cd ConsumerService
mvn clean install && mvn spring-boot:run

πŸ“‚ Project Structure

KafkaProject/
β”œβ”€β”€ ProducerService/     # Kafka Message Producer
β”œβ”€β”€ ConsumerService/     # Kafka Message Consumer
└── README.md


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages