title: What is the right way to run background task in Play 2.1 (Java)?
body: <p>In my app I need to process uploaded documents and put results of processing in DB.<br>
  Documents are stored in file system and metadata is stored in DB.<br>
  For each document it is needed to open and process file from disk, than update metadata in DB accordingly. Processing may be expensive and take long time.<br>
  What I plan to do is:</p>
  
  <ol>
  <li>Span N tasks, one task to process single document</li>
  <li>Each task will go and find oldest, "unprocessed" document</li>
  <li>Task will mark it as "in progress" in DB and start processing it</li>
  <li>After processing document task will update metadata and mark it in DB as "processed"</li>
  <li>Task will go to step 2 after that</li>
  </ol>
  
  <p>What is the right / easiest way to implement this leveraging Play and Akka assuming applicaton is written in Java, not Scala? Source code examples would be also appreciated.</p>