Coder Social home page Coder Social logo

alicanalbayrak / kafka-stream-score-aggregate Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

A starter project for experimenting on KStream and KTable APIs. Fetches (playerName, total goal) and updates scoreboard in on an update.

Shell 16.75% Java 83.25%
kafka-streams java maven docker-compose landoop bash-script

kafka-stream-score-aggregate's Introduction

Kafka Scoreboard Aggregator App

This is a very trivial project to test KStream and KTable APIs. Basically, fetches (playerName,totalGoal) and updates scoreboard in on update.

Getting Started

Prerequisites

  • Java 8+ (tested with v.13)
  • Kafka cluster (and required topcis)

TODO: auto-generate topics

Build

TODO: runnable jar

  • mvn clean package

Run on your local

  1. Go to /docker directory and run docker-compose up -d

    โžœ  docker docker-compose up -d
    Creating network "docker_default" with the default driver
    Creating docker_kafka-cluster_1 ... done
    

    Note the name of the started instance (docker_kafka-cluster_1), we'll use it in the next step.

  2. Connect to docker instance

    docker exec -it docker_kafka-cluster_1  /bin/bash
    
  3. In docker_kafka-cluster_1 run following topic creation commands

    root@fast-data-dev / $ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic input-topic
    Created topic input-topic.
    root@fast-data-dev / $ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic intermediate-table-topic --config cleanup.policy=compact
    Created topic intermediate-table-topic.
    root@fast-data-dev / $ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic output-topic  --config cleanup.policy=compact
    Created topic output-topic.
  4. Start producer

    kafka-console-producer --broker-list localhost:9092 --topic input-topic --property "key.separator=,"
  5. Start consumer

    kafka-console-consumer --bootstrap-server localhost:9092 \
        --topic output-topic \
        --from-beginning \
        --formatter kafka.tools.DefaultMessageFormatter \
        --property print.key=true \
        --property print.value=true \
        --property "key.separator=," \
        --property key.deserializer=org.apache.kafka.common.serialization.StringDeserializer \
        --property value.deserializer=org.apache.kafka.common.serialization.StringDeserializer
  6. Start application

    • TODO
        java -jar app.jar
    

kafka-stream-score-aggregate's People

Contributors

alicanalbayrak avatar dependabot[bot] 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.