Skip to content

This repository contains a Spring Boot project that integrates with Apache Kafka to manage customer data. The API allows creating customer data, which is initially stored in Kafka. The data is then consumed from Kafka and saved into a PostgreSQL database.

Notifications You must be signed in to change notification settings

Mochrks/api-springboot-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot CRUD API - Kafka Integration

Spring Boot Version Kafka Integration PostgreSQL Integration

Tech Stack Icons

Overview

This is a CRUD API built with Spring Boot that integrates Kafka for asynchronous messaging and PostgreSQL as the primary database. The API allows creating, reading, updating, and deleting records while leveraging Kafka for event-driven communication between services. Kafka is used to ensure reliable, scalable, and real-time message delivery.

Features

  • CRUD Operations with Kafka for asynchronous messaging capabilities
  • Integration with Kafka for reliable data communication
  • RESTful API design with clean architecture
  • Spring Kafka for message handling and event processing
  • Input validation and error handling
  • Swagger UI for API documentation and testing

Tech Stack

  • Spring Boot 2.5.4
  • Kafka for event-driven architecture
  • Spring Kafka for Kafka integration
  • PostgreSQL as the primary database
  • Lombok for reducing boilerplate code
  • Swagger for API documentation

Project Structure

api-springboot-kafka/
│
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── com/springboot_kafka/    # Source code and main application
│   ├── resources/
│   │   ├── application.properties       # Configuration for PostgreSQL, Kafka
│   └── test/
│       └── java/                        # Unit tests for services and controllers
└── pom.xml                              # Project dependencies

Setup & Installation


  • Clone the repository

    git clone https://github.com/mochrks/api-springboot-kafka.git
    cd api-springboot-kafka
  • Install dependencies

    mvn clean install
  • Set up Kafka and PostgreSQL

    • Ensure Kafka and PostgreSQL are running locally or provide your connection details in application.properties.
    • Update the following properties in src/main/resources/application.properties:
    spring.kafka.bootstrap-servers=localhost:9092
    spring.datasource.url=jdbc:postgresql://localhost:5432/your_database
    spring.datasource.username=your_username
    spring.datasource.password=your_password
  • Run the application

    mvn spring-boot:run
  • The application will be running on http://localhost:8080.

Connect with me:

GitHub YouTube Instagram LinkedIn Behance Dribbble

About

This repository contains a Spring Boot project that integrates with Apache Kafka to manage customer data. The API allows creating customer data, which is initially stored in Kafka. The data is then consumed from Kafka and saved into a PostgreSQL database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages