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?
Akka Cluster provides a fault-tolerant decentralized peer-to-peer based Cluster Membership Service with no single point of failure or single point of bottleneck. It does this using gossip protocols and an automatic failure detector.
1) Akka Actor tell() Method It works on "fire-forget" approach. You can also use ! (bang) exclamation mark to send message. This is the preferred way of sending messages.
Building application with Akka has several advantages like: High performance – Akka delivers up to 50 million messages per second on commodity hardware having ~2.5 million Actors per GB of RAM.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With