Giter Club home page Giter Club logo

kafka-streams-example's Introduction

About the repository

This project was created to be used as a PoC (Proof of Concept) to group events sent within a time window.

Repository Structure

Client project

Kotlin Project that subscribes all topics and presents all information to understand the flow of the events.

Customer project

Kotlin project with an API to receive a new customer and publish the Customer Created event.

Credit project

Kotlin project that subscribe Customer Created, calculates its score and publish the Score Calculated event.

Segment project

Kotlin project that subscribes to some topics to apply Kafka Streams time window, segment the customer and publish the Customer Segmented event.

How to use

  1. Start all containers using Docker Compose:

    docker-compose up
  2. In a new terminal, build and start Client project

    cd kafka-client && ./gradlew build
    java -jar build/libs/kafka-client-0.0.1-SNAPSHOT.jar
  3. In a new terminal, build and start Customer project

    cd kafka-customer && ./gradlew build
    java -jar build/libs/kafka-customer-0.0.1-SNAPSHOT.jar
  4. In a new terminal, build and start Credit project

    cd kafka-credit && ./gradlew build
    java -jar build/libs/kafka-credit-0.0.1-SNAPSHOT.jar
  5. In a new terminal, build and start Segment project

    cd kafka-segment && ./gradlew build
    java -jar build/libs/kafka-segment-0.0.1-SNAPSHOT.jar
  6. Call Client API with a document that start with first 3 digits below 800

    curl --location --request POST 'http://localhost:8091/user?username=Common&fullname=Some%20Common%20Client&document=59081024663'
  7. Call Client API with a document that start with first 3 digits above 800

    curl --location --request POST 'http://localhost:8091/user?username=Prime&fullname=Some%20Prime%20Customer&document=98872620562'

kafka-streams-example's People

Watchers

Leonardo Bento 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.