Giter Club home page Giter Club logo

apache_kafka_producer_consumer's Introduction

Apache_Kafka_Producer_Consumer

Apache Kakfa Producer Consumer using Java 8

This is a producer consumer application using Kafka

Prerequsities;

  1. Download Zookeeper. Configure the config/zookeeper.properties file. zookeeper is required for kafka to run. Zookeeper will store the kafka configurations
  2. Download Kafka. Configure the config/server.properties

#zookeeper start

zookeeper-server-start.bat config/zookeeper.properties

runs on port 2181

#kafka start

kafka-server-start.bat config/server.properties

#create multiple copies of server.properties and run them separately for multi broker kafka application

runs on port 9092

#Steps

  1. Create a topic
  2. Configure the producer with bootstrapServerHost = "127.0.0.1:9092";
  3. Create a producer with key ProducerRecord<String,String> record = new ProducerRecord<String, String>(topic,key,value); All the records with same key goes to the same partition
  4. Configure the consumer with bootstrapServerHost = "127.0.0.1:9092";
  5. Subscribe consumer to the topic
  6. Run the producer application to publish the data to kafka
  7. Run the consumer application to consume the data from kafka

apache_kafka_producer_consumer's People

Contributors

dineschandgr avatar keethugithub avatar

Stargazers

 avatar

Watchers

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