我对 Akka 很陌生,但到目前为止我真的很喜欢它。我已经能够在本地运行一个小型应用程序,现在我想测试远程部署和使用远程参与者。
为此,我查看并编译了 Java Akka 2.0.1 akka-remote-sample 示例,位于 ..
https://github.com/akka/akka/tree/master/akka-samples/akka-sample-remote
但是当我尝试运行编译的示例时..
java -classpath `pwd`/src/main/resources:target/akka-remote-1.1.jar sample.remote.calculator.java.JCalcApp 我收到有关 application.conf 的错误
我已经多次尝试调整示例 application.conf 文件,但最接近成功运行远程示例应用程序的是..
线程“main”中的异常 akka.remote.RemoteTransportException:无法加载远程传输层 akka.remote.netty.NettyRemoteTransport
我正在使用 Maven shade 插件将我的所有依赖项包含在 jar 中。这适用于本地应用程序。
有人可以看看我的conf文件,让我知道我需要改变什么。
谢谢你 !!
这是我的 application.conf 文件...
//#calculator
calculator {
include "common"
akka {
backoff-timeout = 0ms
remote.backoff-timeout = 0ms
remote.untrusted-mode = off
remote.remote-daemon-ack-timeout = 30s
remote.transport = "akka.remote.netty.NettyRemoteTransport"
remote.log-received-messages = on
remote.log-sent-messages = on
remote.netty.port = 2552
}
}
//#calculator
//#remotelookup
remotelookup {
include "common"
akka {
backoff-timeout = 0ms
remote.backoff-timeout = 0ms
remote.untrusted-mode = off
remote.remote-daemon-ack-timeout = 30s
remote.log-received-messages = on
remote.log-sent-messages = on
remote.transport = "akka.remote.netty.NettyRemoteTransport"
remote.netty.port = 2553
}
}
//#remotelookup
//#remotecreation
remotecreation {
include "common"
akka {
actor {
deployment {
/advancedCalculator {
remote = "akka://CalculatorApplication@127.0.0.1:2552"
}
}
}
backoff-timeout = 0ms
remote.untrusted-mode = off
remote.remote-daemon-ack-timeout = 30s
remote.log-received-messages = on
remote.log-sent-messages = on
remote.transport = "akka.remote.netty.NettyRemoteTransport"
remote.netty.port = 2554
}
}
//#remotecreation
和 common.conf ...
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
netty {
hostname = "127.0.0.1"
}
}
}