Search code examples
javascalatomcatakkamulti-tier

Akka-Java interprocess communication


I have a monolithic Java application (frontend/services) running in Tomcat. I'm trying to come up with a design that will allow me to slowly migrate all the parts of the application as individual tiers to (one or more) Akka actor system(s). As a first redesign, I want to keep the client facing frontend in Tomcat and rewrite some of the middle tier logic in Akka.

I have a couple questions about how to go with this redesign:

  • What's the most efficient way for the frontend to communicate with Akka? I was considering REST but I was wondering if there was anything faster;
  • How hard is it to reuse the existing JPA/hybernate entity model from within Akka? I am looking for documentation/gotchas.

Thanks


Solution

  • Akka supports remoting, which is actors talking to actors on other systems. You can have actors in your Tomcat app communicate with actors in the services running elsewhere.

    Since JPA/Hibernate/JDBC is blocking you should take special care on how you use it in your actor-based apps.