Skip to content

Commit 2032710

Browse files
committed
Add running instruction to readme file
1 parent 230e3a1 commit 2032710

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
11
# Spring Kafka test example
22

3-
Spring Kafka with unit test example
3+
Spring Kafka with unit test example.
4+
5+
## How to run
6+
7+
First start the docker-compose which contains ZooKeeper, Kafka, and Kafdrop.
8+
9+
```bash
10+
$ docker-compose -f docker-compose.yml up -d
11+
```
12+
13+
Once all the containers are healthy start the application,
14+
15+
```bash
16+
$ ./mvnw spring-boot:run
17+
```
18+
19+
Open the browser `localhost:8080/apidocs`.
20+
21+
You can interact with the `random` api to create a random user which then will be sent to Kafka and consumed by the consumer (see `consumer/UserKafkaListener.java` file).
22+
23+
To see whether the message has been sent to Kafka, open your browser `http://localhost:8085/topic/com.madadipouya.kafka.use` (Kafdrop environment),
24+
you should be able to see all messages that sent to `kafka.user` topic.

0 commit comments

Comments
 (0)