- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to keep kafka producer running continuously ?
- Labels:
-
Apache Kafka
Created ‎05-05-2016 07:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I use below command to get data from my_file.txt, it captures all the data and I can get it at consumer console. If my_file.txt is continuosly updating then how can I keep my producer running and keep producing latest data?
kafka-console-producer.sh --broker-list localhost:9092 --topic my_topic < my_file.txt
Created ‎05-05-2016 07:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
did you try tail -f file | kafka-console-producer.sh --broker-list localhost:9092--topic my_topic
Created ‎05-05-2016 07:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
did you try tail -f file | kafka-console-producer.sh --broker-list localhost:9092--topic my_topic
Created ‎05-06-2016 06:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Rajkumar Singh - Thank you! It works.
Created ‎05-05-2016 07:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would also use NiFi's TailFile processor and PutKafka to achieve what you're doing.
Created ‎05-06-2016 06:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @Artem Ervits
