我正在开发一个作为集群运行的项目,它是使用akka-scala API实现的。我的申请主要有4名演员。这些是Client,Dispatcher,WorkDistributor和Worker。
我的application.conf如下,
cluster {
seed-nodes = [
"akka.tcp://application@<IP>:2553"
]
roles = ["frontend", "dispatcher", "backend", "frontRouter", "dispRouter", "backRouter"]
auto-down = on
}
actor.deployment {
lifecycle = on
/client/router {
router = round-robin-group
nr-of-instances = 1
routees.paths = [
"/user/workDispatcher/router"
]
cluster {
allow-local-routees = on
enabled = on
use-role = "frontRouter"
}
}
/workDispatcher/router {
router = round-robin-group
nr-of-instances = 1
routees.paths = [
"/user/workDistributor/router"
]
cluster {
allow-local-routees = on
enabled = on
use-role = "dispRouter"
}
}
/workDistributor/router {
router = round-robin-pool
nr-of-instances = 1
cluster {
enabled = on
allow-local-routees = on
use-role = "backRouter"
}
}
}
已成功通过路由器从客户端收到工作人员的工作,但问题是工作人员在完成工作后发送的消息未传递给客户端。我向客户发送邮件的代码是“sender()!JobComplete”。此消息未传递给客户端。
此外,Dispatcher和WorkDistributor正在作为中间角色。
如果我能解决这个问题,我将不胜感激。
谢谢和问候