Coder Social home page Coder Social logo

kafka-samples's Introduction

kafka-samples

Prerequisities

  • Java
  • Docker
    • On Mac: https://docs.docker.com/docker-for-mac/install/
  • Kafka
    • On Mac: brew install kafka
  • Zookeeper
    • On Mac: brew install zookeeper

Set up Kafka cluster with Zookeeper

Everything is already prepared in docker-compose.yml. Just run in project root directory (replacing <local_ip> with your own IP address - cannot be localhost):

# Start 3 Kafka nodes and Zookeeper node
export HOST_IP=<local_ip> && docker-compose up --scale kafka=3 -d

# Check ports under which Kafka is available
docker port kafka-samples_kafka_1 && \
docker port kafka-samples_kafka_2 && \
docker port kafka-samples_kafka_3

This will start up 1 Zookeeper node and 3 Kafka nodes, which will be available under:

  • Zookeeper: localhost:2181
  • Kafka: localhost:<port_1>, localhost:<port_2>, localhost:<port_3>

When you're done playing you can shutdown everything with docker-compose down.

Exercises

You may find them in the related Java packages, i.e.

  1. Classic approach - com.example.kafka.classic
  2. Kafka Streams - com.example.kafka.streams
  3. Fail-over - com.example.kafka.failover

kafka-samples's People

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.