Hot deployment in akka
Asked Answered
P

1

6

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?

Picrate answered 5/11, 2014 at 19:16 Comment(0)
F
5

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.

Fanaticism answered 6/11, 2014 at 0:56 Comment(4)
Some of my actors have internal mutable state (a mutable list) and also actor tree itself is not fixed and will be changing automatically over time. I want to be able to add or edit methods to actors while preserving running actors and their internal states. I know I can do it in Scala IDE just by editing a code and saving it while app is running in debug mode. Is there really no ways to do the same on production server?Picrate
I've started looking into OSGI term and found out that Eclipse is built on top of it and also other opensource implementations are available. Is this OSGI is what allows me to live edit actors in Scala IDE? In other words, is this the solution?Picrate
Yes, you would have to look at Application Servers that support that functionality, but it is not provided by Akka in general. I'm not sure I have heard of anyone running Akka in a hot-deployable fashion so you might be going into new territory.Fanaticism
Well at least it works pretty well in Scala IDE. Thanks for suggestions.Picrate

© 2022 - 2024 — McMap. All rights reserved.