Deploying new functionality to running actor system

My boss has had a look into Akka. He said that “after all my testing and looking into my requirements for the past 2 years, Scala with its functional and object oriented aspects combined with Akka is an unbeatable environment to work in.” I thought it would be nice to start off with that ;)

He is hoping to use Akka in an IoT project with lots of devices, where he wants the devices to communicate over the network using Akka Actors. He asked me if it’s possible to deploy new “rules/functions/code” on his devices using Akka. As I understand it, he doesn’t want to manually ssh into every device and update the jar, but there should be an automatic mechanism to update many devices at once.

I’m not sure what the options are for this, so I’m asking here (and letting him know). If there is a solution above the scope of Akka, of course that would be helpful too.

There’s nothing that would do that out of the box, I’m sure you could device something though, or use some system level tool to do that. I don’t know any specific tool to advice though.

Java and the JVM has a history of trying to achieve this hot-reloading redeploy in the same JVM and some of the old middleware/app-servers support it. It is however very easy to end up with class loader leaks which are very hard to debug and I think the general JVM community consensus is that it is better to avoid it and instead do actual process restarts.

What I ended up suggesting is to have a top-level actor system with Actors that can “wrap” and execute .jar processes. These .jars can be “sent” to the actor system from a secure source, and running processes can be stopped, or updated and restarted by talking to the actor which is supervising a process.

I like how this works with the “let it crash” (and restart) philosophy. Of course you end up running multiple JVM’s during the execution of a .jar/job, but I think that’s the lesser evil.

Those jars could even contain actors that join and communicate with existing actors.

Akka or actor model is a good choice for IoT project. We are doing that since 2014. Actor Model or more precisely Finite State Machine is an excellent model for stateful business logic which managing IoT device is.
Like Johan said. Akka can not solve your problem out of the box. But it is a excellent tools for it.