【问题标题】:Akka Messages in Subprojects?子项目中的 Akka 消息?
【发布时间】:2014-12-03 17:33:45
【问题描述】:

我有一条消息要通过 Akka 中的集群发送。我有两个后端节点和一个前端节点。后端节点正常出现,但前端节点没有出现(关联失败)。

我觉得我有一个关于为什么会这样的提示:我有一个工作配置(前端出现并且可以正常发送和接收消息),但是前端、后端和公共消息都在同一个包中。当我将这些拆分为单独的子项目(通用、前端和后端)时,代码会中断。有什么明显的原因吗?另外,堆栈跟踪:

[INFO] [10/08/2014 17:00:32.385] [ClusterSystem-akka.actor.default-dispatcher-14] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@192.168.1.2:62701] - Welcome from [akka.tcp://ClusterSystem@192.168.1.7:2552]
[INFO] [10/08/2014 17:00:32.425] [ClusterSystem-akka.actor.default-dispatcher-14] [akka://ClusterSystem/system/cluster/core/daemon/joinSeedNodeProcess-1] Message [akka.cluster.InternalClusterAction$InitJoinAck] from Actor[akka.tcp://ClusterSystem@192.168.1.7:2551/system/cluster/core/daemon#1100391461] to Actor[akka://ClusterSystem/system/cluster/core/daemon/joinSeedNodeProcess-1#217838192] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[WARN] [10/08/2014 17:00:33.281] [ClusterSystem-akka.remote.default-remote-dispatcher-6] [akka.tcp://ClusterSystem@192.168.1.2:62701/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40192.168.1.7%3A2551-0] Association with remote system [akka.tcp://ClusterSystem@192.168.1.7:2551] has failed, address is now gated for [5000] ms. Reason is: [sample.cluster.transformation.BackendRegistration$].

我觉得这一定有一个明显的原因。我的 Build.scala 文件有依赖项,我导入了我需要的类/对象,但是将它们放在单独的子项目中会影响什么吗?

【问题讨论】:

  • 如果您将项目拆分为子项目,那么它们无法访问其他类,除非您在 sbt 配置文件中使用dependsOnhere 您可以找到文档。
  • 我确实有dependsOn(我认为没有它就无法编译)。一切都编译得很好,只是在运行前端时无法正常运行。后端运行良好。

标签: scala sbt akka akka-cluster


【解决方案1】:

我想通了……

似乎我的远程系统具有旧配置,其中消息位于同一包中,而前端具有子项目(子项目中的公共包)的配置。似乎序列化确实关心这一点,即使案例对象和案例类具有相同的签名,但前端和后端的包不同。

【讨论】:

  • 是的,可以将package 视为namespace
猜你喜欢
  • 2018-09-29
  • 2012-07-02
  • 1970-01-01
  • 2018-12-24
  • 2013-09-11
  • 2016-10-08
  • 2015-02-22
  • 1970-01-01
  • 2011-09-06
相关资源
最近更新 更多