Giter Site home page Giter Site logo

messenger's Introduction

Take home task

Approach

  • Implement a Spring Boot REST API to handle user creation and message sending functionalities.
  • Incorporate a PostgreSQL database system to store messages persistently.
  • Integrate Apache Kafka into the system to facilitate message communication between users. Configure Apache Kafka with partitions and replicas for scalability and fault tolerance.
  • Enable partitioning to maintain the order of messages. The producer service generates a partition number using the hash code of the sender ID and receiver ID, ensuring that messages are distributed across partitions effectively.
  • Implement a consumer service to listen for messages from the Kafka topic and deliver them to the corresponding users.
  • Integrate WebSocket functionality into the consumer service to enable real-time message delivery to users.
  • To scale the application further, additional consumers can be added, each assigned to handle messages from specific partitions, ensuring efficient processing and load balancing.

Prerequisites

  • Docker 19.03.x (for production level readiness)
  • Docker Compose 1.25.x
  • Maven 3

Used Technologies

  • Spring Boot 3
  • Spring Data
  • Lombok
  • Actuator
  • Postgresql
  • Apache Kafka
  • Websocket

How to run

Package application as a JAR file

mvn clean install -DskipTests

Run Kafka with Zookeeper and Postgresql

docker-compose up -d

Run Spring Boot application

mvn spring-boot:run

Or, run as Java -jar

java -jar target/messenger-0.0.1-SNAPSHOT.jar

messenger's People

Contributors

shohelasad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.