Kafka producer to read data files
<p>I am trying to load a data file in loop(to check stats) instead of standard input in Kafka. After downloading Kafka, I performed the following steps:</p>

<p>Started zookeeper:</p>

<pre><code>bin/zookeeper-server-start.sh config/zookeeper.properties
</code></pre>

<p>Started Server:</p>

<pre><code>bin/kafka-server-start.sh config/server.properties
</code></pre>

<p>Created a topic named "test":</p>

<pre><code>bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
</code></pre>

<p>Ran the Producer:</p>

<pre><code>bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test 
Test1
Test2
</code></pre>

<p>Listened by the Consumer:</p>

<pre><code>bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
Test1
Test2
</code></pre>

<p>Instead of Standard input, I want to pass a data file to the Producer which can be seen directly by the Consumer. Or is there any kafka producer instead of console consumer using which I can read data files. Any help would really be appreciated. Thanks!</p>