Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Kafka Demo using Java with multiple data Serialization (Protobuf, JSON, Avro etc)

NotificationsYou must be signed in to change notification settings

telkomdev/KafkaDemoJava

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Kafka

$ docker-compose up

Show KafkaTopic list

$ ./opt/kafka/bin/kafka-topics.sh --list --zookeeper zookeeper:2181

Create KafkaTopic with namedemo

$ ./opt/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 100 --topic demo

Show KafkaTopic information from topicdemo

$ ./opt/kafka/bin/kafka-topics.sh --describe --topic demo --zookeeper zookeeper:2181

Run Producer

$cd Producer

Build

$ mvn clean package

Send message to broker

$ BROKERS=localhost:9092 TOPIC=demo java -jar target/Producer-1.0-SNAPSHOT.jar$ Type Message (type'exit' to quit)$ hello

Run Consumer

$cd Consumer

Build

$ mvn clean package

Receive message from broker

$ BROKERS=localhost:9092 TOPIC=demo java -jar target/Consumer-1.0-SNAPSHOT.jar$ Record Key null$ Record value Product{id='001', name='Nokia 6', quantity=5, images=[wuriyanto.com/img1, wuriyanto.com/img2]}$ Record partition 49$ Record offset 0

About

Kafka Demo using Java with multiple data Serialization (Protobuf, JSON, Avro etc)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp