title: Java Spring: Real-time status update to the client over REST API
body: <p>I am developing a web application in Java Spring where I want the user to be able to upload a CSV file from the front-end and then see the real-time progress of the importing process and after importing he should be able to search individual entries from the imported data.</p>
  
  <p>The importing process would consist of actually uploading the file (sending it via REST API POST request) and then reading it and saving its contents to a database so the user would be able to search from this data. </p>
  
  <p>How could I show the real-time progress of this process? I found a tutorial for jQuery, which shows the progress of amount of data uploaded/transferred, but as the most the work is done while processing the uploaded file, I thought I would like a solution where before the line processing I find out the amount of lines in the file and then the user could see a live message like:</p>
  
  <blockquote>
    <p>Lines processed: 1 out of 10000</p>
  </blockquote>
  
  <p>It could update/change incrementally, but as one line is processed pretty quickly, showing each number of lines processed is not that important.</p>
  
  <p>Either way, the question is, what's the easiest way to send these messages from Spring REST API to the client?</p>