2011-08-02 07:41:24 +08:00
|
|
|
This directory contains examples of client code that uses kafka.
|
|
|
|
|
2020-04-30 10:31:26 +08:00
|
|
|
To run the demo:
|
2011-08-02 07:41:24 +08:00
|
|
|
|
2022-10-18 13:03:52 +08:00
|
|
|
1. In Zookeeper mode, Start Zookeeper and the Kafka server. In KRaft mode, start the Kafka server.
|
2020-04-30 10:31:26 +08:00
|
|
|
2. For unlimited sync-producer-consumer run, `run bin/java-producer-consumer-demo.sh sync`
|
|
|
|
3. For unlimited async-producer-consumer run, `run bin/java-producer-consumer-demo.sh`
|
|
|
|
4. For exactly once demo run, `run bin/exactly-once-demo.sh 6 3 50000`,
|
2020-02-21 01:59:09 +08:00
|
|
|
this means we are starting 3 EOS instances with 6 topic partitions and 50000 pre-populated records.
|
2020-04-30 10:31:26 +08:00
|
|
|
5. Some notes for exactly once demo:
|
|
|
|
5.1. The Kafka server has to be on broker version 2.5 or higher.
|
2022-10-18 13:03:52 +08:00
|
|
|
5.2. You could also use IntelliJ IDEA to run the example directly by configuring parameters as "Program arguments"
|