Commit 280f1270 authored by Shanelle Valencia's avatar Shanelle Valencia

[AFP-53] 📝 Add readme instructions to test kafka producer and consumer [@svalencia]

parent 398c791e
Pipeline #1681 canceled with stage
......@@ -58,3 +58,24 @@ Example Console Response:
2021-05-05 17:13:29.932 INFO 82715 --- [ntainer#0-0-C-1] c.afp.ordermanagement.service.Consumer : #### -> Consumed message -> somethinghere
```
## Testing Kafka Producer and Consumer
Make sure kafka server and zookeeper are running
To create a kafka topic:
kafka-topics.sh --describe --topic <insert-topic-here> --bootstrap-server localhost:9092
if the above command doesn't work, try:
/usr/local/Cellar/kafka/2.8.0/bin/kafka-topics --describe --topic orders --bootstrap-server localhost:9092
To start kafka console for producer:
kafka-console-producer.sh --topic orders --bootstrap-server localhost:9092
-OR-
/usr/local/Cellar/kafka/2.8.0/bin/kafka-console-producer --topic orders --bootstrap-server localhost:9092
To start kafka console for consumer:
kafka-console-consumer.sh --topic orders --from-beginning --bootstrap-server localhost:9092
-OR-
/usr/local/Cellar/kafka/2.8.0/bin/kafka-console-consumer --topic orders --from-beginning --bootstrap-server localhost:9092 (--from-beginning flag will show all messages that were received for this particular topic)
if you're still getting errors finding the pathway for kafka, try running:
ls -alrth /usr/local/Cellar/kafka/
then find your way to the bin directory where you'll find all the kafka commands
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment