title: How to integrate Apache Spark with Spring MVC web application for interactive user sessions
body: <p>I am trying to build a Movie Recommender System Using Apache Spark MLlib.
  I have written a code for recommender in java  and its working fine when run using <code>spark-submit</code> command.</p>
  
  <p>My run command looks like this</p>
  
  <p><code>bin/spark-submit --jars /opt/poc/spark-1.3.1-bin-hadoop2.6/mllib/spark-mllib_2.10-1.0.0.jar --class "com.recommender.MovieLensALSExtended" --master local[4] /home/sarvesh/Desktop/spark-test/recommender.jar /home/sarvesh/Desktop/spark-test/ml-latest-small/ratings.csv /home/sarvesh/Desktop/spark-test/ml-latest-small/movies.csv</code></p>
  
  <p>Now I want to use my recommender in real world scenario, as a web application in which I can query recommender to give some result.</p>
  
  <p>I want to build a Spring MVC web application which can interact with Apache Spark Context and give me results when asked.</p>
  
  <p>My question is that how I can build an application which interacts with Apache Spark which is running on a cluster. So that when a request comes to controller it should take user query and fetch the same result as the <code>spark-submit</code> command outputs on console.</p>
  
  <p>As far as I have searched, I found that we can use Spark SQL, integrate with JDBC. But I did not find any good example.</p>
  
  <p>Thanks in advance.</p>