문제

I'm trying to configure some akka actors to have a durable mailbox within the context of a play2 application.

The configuration in application.conf is being read as MongoBasedMailboxType is being instantiated.

event-dispatcher { mailbox-type = akka.actor.mailbox.MongoBasedMailboxType }

However I'm running into this exception.

java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps;
    at akka.util.Duration$.<init>(Duration.scala:76)
    at akka.util.Duration$.<clinit>(Duration.scala)
    at akka.actor.mailbox.MongoBasedMailboxSettings.<init>(MongoBasedMailboxSettings.scala:21)
    at akka.actor.mailbox.MongoBasedMailboxType.<init>(MongoBasedMailbox.scala:26)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

I believe the cause is that the configuration below is not being recognized.

akka {
  actor {
    mailbox {
      mongodb {

        uri = "mongodb://localhost/akka.mailbox"
        timeout {
          # time to wait for a read to succeed before timing out the future
          read = 3000 ms
          # time to wait for a write to succeed before timing out the future
          write = 3000 ms
        }
      }
    }
  }
}

I've also tried wrapping the akka {... } in play {} without luck.

  • scalaVersion := "2.10.1"
  • "com.typesafe.akka" % "akka-mongo-mailbox" % "2.0.5"
  • addSbtPlugin("play" % "sbt-plugin" % "2.1.5")
도움이 되었습니까?

해결책

Akka-mongo-mailbox 2.0.5 depends on akka-mailboxes-common 2.0.5 which depends on akka 2.0.5, but with play 2.1.5 you have akka 2.1 so you get an api mismatch. Not sure what do do about it though, ask on the akka mailing list maybe?

다른 팁

The question was answered on the mailing list:

""" don't know of any open source project implementing a durable mailbox for akka 2.1 for mongo or redis.

If you want to implement your own, the source code for the 2.0.5 versions is available here https://github.com/akka/akka/tree/v2.0.5/akka-durable-mailboxes """

https://groups.google.com/forum/#!topic/akka-user/50c2HZa1OFU

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top