项目作者: cricketsamya

项目描述 :
Spring Boot Application using Kafka Consumer with Zookeeper
高级语言: Java
项目地址: git://github.com/cricketsamya/kafka-consumer.git
创建时间: 2021-03-04T10:28:28Z
项目社区:https://github.com/cricketsamya/kafka-consumer

开源协议:Apache License 2.0

下载


kafka-consumer

Spring Boot Application using Kafka Consumer with Zookeeper

Consumer consumes messages MessageObject(identifier=d7ea610b-9087-438c-9b52-1913a17ec2a9, action=SEND EMAIL) from
producer over Kafka, and LOGs the message. Next step is to Containerize.

*Note: Java 11 is required.

Zookeeper Setup

  1. Download and Unzip Zookeeper.
  2. Goto conf directory. Then cp zoo_sample.cfg zoo.cfg
  3. Optional: Change dataDir in the zoo.cfg, as default is pointed to /tmp/data.

To start Zookeeper

  1. Goto bin folder.
  2. Execute ./zkServer.sh start

To stop Zookeeper

  1. Goto bin folder.
  2. Execute ./zkServer.sh stop

Kafka Setup

  1. Download and Unzip Kafka.
  2. Goto config folder and open server.properties.
  3. Then uncomment listeners=PLAINTEXT://:9092. This will allow Kafka broker to listen on port 9092.
  4. Optional: Change log.dirs in the server.properties.
  5. Optional: zookeeper.connect in server.properties defines Zookeeper properties.

To start Kafka

  1. Goto bin folder.
  2. Execute ./bin/kafka-server-start.sh config/server.properties

To stop Kafka

  1. Goto bin folder.
  2. Execute ./bin/kafka-server-stop.sh

To run Consumer

execute ./gradlew bootRun

*Consumer works with https://github.com/cricketsamya/kafka-producer