push data from text file to Kafka continuously
<p>i have create a simple producer that read data from textfile and send it to kafka </p>

<pre><code>try(BufferedReader br = new BufferedReader(new      FileReader(getInputFileName()))) {
        String line = br.readLine();
        while (line != null) {
            KeyedMessage&lt;String, String&gt; data = new KeyedMessage&lt;String, String&gt;(getTopic(), null, line);
            producer.send(data);
            System.out.println(line);
            //Thread.sleep(200l);
            line = br.readLine();
</code></pre>

<p>and it is working perfectly but it only buffer the data at that time and send it , so if some one change the Textfile and add new line , these new data will not be sent to the kafka </p>

<p>i need to know if i can do something that will continuously capture the new lines that inserted to the textfile and send it automatically to kafka .</p>

<p>any help ?</p>