Skip to content

Mikbac/Kafka-overview-and-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka demo

Docs

Projects


Create topic

./kafka-topics.sh --create \
  --topic quickstart-events \
  --bootstrap-server localhost:9192

or

./kafka-topics.sh --create \
  --topic quickstart-events \
  --replication-factor 1 \
  --partitions 3 \
  --bootstrap-server localhost:9192

Produce Log/Message

./kafka-console-producer.sh \
    --broker-list localhost:9192 \
    --topic quickstart-events

With key:

./kafka-console-producer.bat \
  --broker-list localhost:9192 \
  --topic quickstart-events \
  --property "key.separator=-" \
  --property "parse.key=true"

Input e.g. <KEY>-<VALUE>


Consume Log/Message

./kafka-console-consumer.sh \
  --bootstrap-server localhost:9192 \
  --topic quickstart-events \
  --from-beginning

With key:

./kafka-console-consumer.sh \
  --bootstrap-server localhost:9192 \
  --topic quickstart-events \
  --from-beginning \
  --property "key.separator=-" \
  --property "print.key=true"

With Consumer Group:

./kafka-console-consumer.sh \
  --bootstrap-server localhost:9192 \
  --topic quickstart-events \
  --group <group-name>

List the topics in a cluster

./kafka-topics.sh --bootstrap-server localhost:9192 --list

List the consumer groups

./kafka-consumer-groups.sh --bootstrap-server localhost:9192 --list

About

No description or website provided.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published