Module stability: STABLE

When using Akkas embedded servlet container:

Akka supports the upcoming JSR for REST called JAX-RS (JSR-311). It allows you to annotate your Active Objects and/or Actors with JAX-RS annotation to expose them as REST services through JSON, XML, HTML, Thrift, Protobuf etc.

You can deploy your REST services directly into the Akka kernel. All you have to do is to drop the JAR with your application containing the REST services into the ‘$AKKA_HOME/deploy’ directory and define a “boot class”. WAR deployment is coming soon.

Boot configuration class

The boot class is needed for Akka to bootstrap the application and should contain the initial supervisor configuration of the REST components. This is needed in order to register them as JAX-RS services.

The boot class should be a regular POJO with a default constructor in which the initial configuration is done. The boot class then needs to be defined in the ‘$AKKA_HOME/config/akka.conf’ config file like this:
  boot = ["", "sample.scala.Boot"]   # FQN to the class doing initial active object/actor
                                                     # supervisor bootstrap, should be defined in default constructor

When deploying in another servlet container:

If you deploy Akka in another JEE container, don't forget to add Akkas initialization and cleanup hook:

Here are an Active Object and Actor example of a REST service with a boot class.

Java API: Active Objects

RESTful Active Object.
public class HelloService {
  public String hello() {
    return "hello"

Boot class defining the Active Object.
public class Boot {
  public Boot() throws Exception  {
    ActiveObjectManager manager = new ActiveObjectManager();
        new RestartStrategy(new OneForOne(), 3, 5000, new Class[]{Exception.class}),
        new Component[] {
          new Component(
            new LifeCycle(new Permanent(), 1000),

Scala API: Actors

RESTful Actor.
class HelloActor extends Actor {
  private case object Hello
  def hello = (this !! Hello).getOrElse("Couldn't say hello")
  def receive = {
    case Hello => reply("hello")

Boot class defining the Actor.
class Boot {
  val factory = SupervisorFactory(
      RestartStrategy(OneForOne, 3, 100, List(classOf[Exception])),
        new HelloActor,
      :: Nil))

Take the Maven POM file from the akka-samples-scala as an example on how to build and deploy this example.

Using Akka with the Pinky REST/MVC framework

Pinky has a slick Akka integration. Read more here
Home Turn Off "Getting Started"