-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkafka-sample-instructions.txt
54 lines (37 loc) · 1.53 KB
/
kafka-sample-instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---[ Kafka sample - Instructions ]---
Start Zookeeper
$ cd /path/to/kafka/bin
$ ./zookeeper-server-start.sh -daemon ../config/zookeeper.properties
or to see logs
$ ./zookeeper-server-start.sh ../config/zookeeper.properties
Start Kafka
$ cd /path/to/kafka/bin
$ ./kafka-server-start.sh -daemon ../config/server.properties
or to see logs
$ ./kafka-server-start.sh ../config/server.properties
Create required topics
$ cd /path/to/kafka/bin
$ ./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic rabbitsimple
$ ./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic rabbitcomplex
$ ./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic rabbitnested
List topics
$ cd /path/to/kafka/bin
$ ./kafka-topics.sh --list --zookeeper localhost:2181
Start Producer
$ cd /path/to/kafkasample/kafkaproducer/
$ ./gradlew clean build
$ ./gradlew bootRun
or java -jar build/libs/kafkaproducer-0.1.jar
Start Consumer
$ cd /path/to/kafkasample/kafkaconsumer/
$ ./gradlew clean build
$ ./gradlew bootRun
or java -jar build/libs/kafkaconsumer-0.1.jar
Testing with Postaman
import the postman collection in /path/to/kafkasample/postman
execute some requests against the producer and look at the console of the consumer what's happen
execute some requests against the consumer and verify if the results are same as consumer's logs
Stop Kafka
$ ./kafka-server-stop.sh
Stop Zookeeper
$ ./zookeeper-server-stop.sh