Coder Social home page Coder Social logo

kafka-cassandra-poc's Introduction

Kafka - Cassandra demo

The app consists of two parts:

  • Kafka Producer - generates random messages and sends them to Kafka
  • Kafka Consumer - reads messages from Kafka topic and stores them in Cassandra

Requirements

Setup

To run the app, first execute the following cmd from the project root:

vagrant up

This will start up the Vagrant box. The first time will take a while as it has to download the OS image and other dependencies.

To start-up the producer app, run the following cmd from the kafka-producer folder:

$ mvn spring-boot:run

Note: the producer will terminate after the messages have been sent

To start-up the consumer app, run the following cmd from the kafka-consumer folder:

$ mvn spring-boot:run

Note: the consumer will keep listening for new messages until manually terminated

Shutting down the vagrant box can be done by typing

vagrant halt

Misc. commands

Creating a Kafka topic:

./kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic myTopic

List all Kafka topics:

./kafka/bin/kafka-topics.sh --list --zookeeper localhost:2181

Run the console producer:

./kafka/bin/kafka-console-producer.sh --broker-list 192.168.33.10:9092 --topic myTopic

Run the console consumer:

./kafka/bin/kafka-console-consumer.sh --zookeeper 192.168.33.10:2181 --topic myTopic --from-beginning

Run Cassandra terminal client:

./cassandra/bin/cqlsh

About

A simple demo to show how Kafka works together with Cassandra

Used technologies:

  • Spring Boot
  • Apache Kafka
  • Cassandra

kafka-cassandra-poc's People

Contributors

tom-causs avatar

Stargazers

Nilesh Patil avatar

Watchers

Tom Van den Bulck 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.