Giter Club home page Giter Club logo

sample-kafka-application's Introduction

Sample-Kafka-Application

Instructions along with sample code base for basic kafka project

#Source: https://www.udemy.com/apache-kafka/

Installation Steps in Mac OS X

  • Install brew if needed: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Download and Setup Java 8 JDK:
    1. brew tap caskroom/versions
    2. brew cask install java8
  • Download & Extract the Kafka binaries from https://kafka.apache.org/downloads
  • Install Kafka commands using brew: brew install kafka
  • Create data/zookeeper, data/kafka in folder
  • Edit Zookeeper & Kafka configs using a text editor
    1. zookeeper.properties: dataDir=/your/path/to/data/zookeeper
    2. server.properties: log.dirs=/your/path/to/data/kafka

Sample Command Lines

  • Start Zookeeper (run in installed kafka directory): zookeeper-server-start config/zookeeper.properties
  • Start Kafka (run in installed kafka directory): kafka-server-start config/server.properties
  • Kafka Topics
    1. Create Kafka Topic: kafka-topics --zookeeper 127.0.0.1:2181 --topic topic1 --create --partitions 3 --replication-factor 1
    2. List Kafka Topics: kafka-topics --zookeeper 127.0.0.1:2181 --list
    3. Describe Topic: kafka-topics --zookeeper 127.0.0.1:2181 --topic topicName --describe
    4. Delete Topic: kafka-topics --zookeeper 127.0.0.1:2181 --topic topicName --delete
  • Kafka Producer Consumer
    1. produce message for a particular topic: kafka-console-producer --broker-list 127.0.0.1:9092 --topic topic1
    2. Consume message from topic from beginning: kafka-console-consumer --bootstrap-server 127.0.0.1:9092 --topic topic1 --from-beginning
    3. Consume with consumer group: kafka-console-consumer --bootstrap-server 127.0.0.1:9092 --topic topic1 --group consumer-group-1
    4. List all consumer groups: kafka-consumer-groups --bootstrap-server localhost:9092 --list

sample-kafka-application's People

Contributors

subhasmitasahoo 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.