We are building a multiple-component Akka-cluster-based system. Every component is a separate Play! project and on start it joins the Akka Cluster and components start looking-up actors to work.
Problem
I have two problems with this setup:
Writing test code is very hard (we didn't figure out this yet), specially when writing tests that rely on multiple actors coming from different components. How can we solve dependency and create a proper cluster in the test-code (between two play applications!)
During development, every developer has to start multiple Sbt instances to boot the system (different play projects) and this eats the entire system memory and development becomes incredible slow.
What I'm Looking For
I was thinking of using the cluster "roles" property to do selective boot-up, this means that there is only a single Play project and components are (modules) and on-boot of the play project I will scan the current "roles" property of this instance and based on that I start or stop certain components/actors.
This will make testing easier but I don't know exactly how to do this in Play, specially that some components actually offer RESTful API (Play Controllers) and I don't know how to enable/disable routes and controllers on boot-time of play.
Is there any document or something that shows the right way to build a modular distributed system or any clues? (something also that relates to how SBT should be setup?
Edit 1: The project lives in a single repository and has a single sbt build (multiple-projects)