Search code examples
javaplayframeworkakkaplayframework-1.x

Is it possible to use Play 1.x and Akka together?


Has anyone tried integrating Akka with Play 1.x? What is your experience? I just saw that Play 1.x has had a module for Akka support for a long time: https://github.com/dwhitney/akka

I guess, the question I am asking is, if I need to move to using Akka, having developed a large Play 1.x app, do I need to rewrite it to use Play 2.x to get the full benefits of Akka?


Solution

  • Didn't try that module (it's probably deprecated now with recent versions of Akka) but technically you can use Akka in Java, so you could integrate Akka actors to Play 1.x jobs by adding the right Akka dependency.

    This way you could have the benefits of Akka in your app (migrating from Play 1.x to Play 2.x is not straightforward).

    Another option could be to have a dedicated Play 2.x app that handles Akka jobs on it's own and have your two apps interact with each other (ie with webservices). That would allow you to use Scala syntax, which I find way more practical with Akka.

    In the end it mostly depends of your architecutre, the kind of jobs you have to run and whether or not they can be split from your main app.