Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kafka consumer in shell script

I am newbie in Kafka. I want to consume remote kafka message in shell script. Basically I have linux machine where I cannot run any web server (some strange reasons) only thing I can do is use crontab/shell script to listen for kafka message which is hosted remotely. Is it possible to write simple shell script which will consume kafka message, parse it and take corresponding action.

like image 921
Rishi Saraf Avatar asked Aug 31 '25 04:08

Rishi Saraf


1 Answers

kafka clients are available in multiple languages. you can use any client, you don't need any web server or browser for it.
you may use shell script for consuming message & parsing but that script have to use any kafka client provided here because currently there is no client written in pure shell script. Kafka has provided kafka client console producer and consumer, you can use that as well.

 bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning

follow the document properly.

like image 141
anand Avatar answered Sep 04 '25 06:09

anand