title: Java - Apache Spark communication
body: <p>I'm quite new to Spark and was looking for some guidance :-)</p>
  
  <p>What's the typical way in which a Java MVC application communicates with Spark? To simplify things, let's say I want to count the words in a certain file whose name is provided via GET request to my server.</p>
  
  <p>My initial approach was to open the context and implement the transformations/ computations in a class inside my MVC application. That means that at runtime I would have to come up with an uber jar of spark-core. The problem is that:</p>
  
  <ul>
  <li>The uber jar weights 80mb</li>
  <li>I am facing the same problem (akka.version) than in: <a href="https://stackoverflow.com/questions/30597376/apache-spark-akka-version-error-by-build-jar-with-all-dependencies">apache spark: akka version error by build jar with all dependencies</a></li>
  <li>I can have a go with shade to solve it but have the feeling this is not the way to go.</li>
  </ul>
  
  <p>Maybe the "provided" scope in Maven would help me but I'm using ant.</p>
  
  <p>Should my application - as suggested in the page - have already one jar with the implementation (devoid of any spark libraries) and use the spark-submit every time I receive a request. I guess it would leave the results somewhere.</p>
  
  <p>Am I missing any middle-of-the-road approach?</p>