louis1204
louis1204

Reputation: 411

Adding to Config file for Akka

My environment is eclipse indigo and I am trying to add a custom dispatcher.

import akka.actor.Actor
import akka.actor.ActorRef
import akka.dispatch.MessageDispatcher
import akka.dispatch._
import akka.event.Logging
import akka.actor.ActorSystem
import akka.actor.Props
import akka.dispatch;

class MyActor extends Actor {
    Console.println("World!");
    val log = Logging(context.system, this)
    def receive = {
        case "test" => log.info("received test")
        case _      => log.info("received unknown message")
    }
}  

object Main extends App {    

    val system = ActorSystem("MySystem")
        Console.println("Hello");
    val myActor = system.actorOf(Props[MyActor].withDispatcher("my-dispatcher"), name = "myactor")
}

I am following this example. http://doc.akka.io/docs/akka/2.0.2/scala/dispatchers.html

I've already tried adding it to application.config in akka-2.0.2/config/application.config

Upvotes: 1

Views: 2467

Answers (1)

drexin
drexin

Reputation: 24403

In your project just put application.conf in the src/main/resources folder. That should work.

Upvotes: 8

Related Questions