Search code examples
scalaakkahotdeploy

Hot deployment in akka


In these slides: http://www.slideshare.net/jboner/introducing-akka I've read that Akka supports hot deployment. The way I understand this term is I'll be able to make code changes without restarting my application and losing it's current state.

That's exactly what I may need for my scala/akka application. But how do I actually do a hot deployment? What tools and techniques should I use?


Solution

  • It isn't clear what state you want to maintain? The mailboxes of the actors? Configuration of remoting? All of that is non-trivial to reason about in normal circumstances not too mention hot swapping.

    If you are thinking of something along the lines of OSGI hot deployment then no in general you cannot. You have a few options though.

    You can change an actors behavior at runtime using a variety of methods the easiest would be become/unbecome. This is sometimes what is meant by hotswap.

    A generic approach might be to deploy your new code to new nodes join a cluster and then kill off previous nodes.