首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >来自`ClusterReceptionist`的消息未到达`DistributedPubSubMediator`

来自`ClusterReceptionist`的消息未到达`DistributedPubSubMediator`
EN

Stack Overflow用户
提问于 2017-05-04 14:07:37
回答 1查看 231关注 0票数 0

我正在尝试通过ClusterClient向一个Akka集群发送一个简单的字符串"Dummy string"。设置很好,我已经连接了前端和集群,但是从ClusterReceptionist发送到DistributedPubSub mediator的Send消息被传递到了DeadLetters

如果我安排另一条Send消息稍后从集群内部发送到中介器,它就能正常工作。

请帮帮忙,提前谢谢。

前端日志:

代码语言:javascript
复制
22:51:34,645 DEBUG akka.remote.EndpointWriter - sending message RemoteMessage: [Send(user/UserServiceProxy,Dummy string,true)] to [Actor[akka.tcp://PvpCluster@127.0.0.1:2552/system/receptionist#-1744655285]]<+[akka.tcp://PvpCluster@127.0.0.1:2552/system/receptionist] from [Actor[akka://PvpFrontend/deadLetters]]
22:51:34,646 DEBUG akka.serialization.Serialization(akka://PvpFrontend) - Using serializer [akka.cluster.pubsub.protobuf.DistributedPubSubMessageSerializer] for message [akka.cluster.pubsub.DistributedPubSubMediator$Send]

集群日志:

代码语言:javascript
复制
22:51:34,626 DEBUG akka.remote.EndpointWriter - sending message RemoteMessage: [ActorIdentity([B@11b5bea7,Some(Actor[akka://PvpCluster/system/receptionist#-1744655285]))] to [Actor[akka.tcp://PvpFrontend@localhost:3000/user/cluster-client#-2107174838]]<+[akka.tcp://PvpFrontend@localhost:3000/user/cluster-client] from [Actor[akka://PvpCluster/deadLetters]]
22:51:34,654 DEBUG akka.remote.EndpointWriter - received local message RemoteMessage: [Send(user/UserServiceProxy,Dummy string,true)] to [Actor[akka://PvpCluster/system/receptionist#-1744655285]]<+[akka://PvpCluster/system/receptionist] from [Actor[akka.tcp://PvpFrontend@localhost:3000/deadLetters]()]
22:51:34,657 DEBUG akka.cluster.client.ClusterReceptionist$Internal$ClientResponseTunnel - started (akka.cluster.client.ClusterReceptionist$Internal$ClientResponseTunnel@476348f0)
22:51:34,657 DEBUG akka.cluster.client.ClusterReceptionist - now supervising Actor[akka://PvpCluster/system/receptionist/akka.tcp%3A%2F%2FPvpFrontend%40localhost%3A3000%2FdeadLetters#552013204]
22:51:34,657 INFO akka.actor.RepointableActorRef - Message [java.lang.String] from Actor[akka://PvpCluster/system/receptionist/akka.tcp%3A%2F%2FPvpFrontend%40localhost%3A3000%2FdeadLetters#552013204] to Actor[akka://PvpCluster/system/distributedPubSubMediator#-1480760039] was not delivered. [5] 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'.
22:51:34,892 DEBUG akka.serialization.Serialization(akka://PvpCluster) - Using serializer [akka.serialization.JavaSerializer] for message [akka.remote.Ack]
22:51:36,439 DEBUG akka.remote.EndpointWriter - received local message RemoteMessage: [Heartbeat] to [Actor[akka://PvpCluster/system/receptionist#-1744655285]]<+[akka://PvpCluster/system/receptionist] from [Actor[akka.tcp://PvpFrontend@localhost:3000/user/cluster-client#-2107174838]()]
22:51:36,440 DEBUG akka.cluster.client.ClusterReceptionist - Received new contact from [akka.tcp://PvpFrontend@localhost:3000/user/cluster-client]
22:51:36,440 DEBUG akka.remote.EndpointWriter - sending message RemoteMessage: [HeartbeatRsp] to [Actor[akka.tcp://PvpFrontend@localhost:3000/user/cluster-client#-2107174838]]<+[akka.tcp://PvpFrontend@localhost:3000/user/cluster-client] from [Actor[akka://PvpCluster/system/receptionist#-1744655285]]
22:51:36,837 DEBUG akka.remote.transport.ProtocolStateActor - stopped
EN

回答 1

Stack Overflow用户

发布于 2017-06-14 19:56:00

在不看到代码的情况下很难确定,但通常会发生这种情况,因为您忘记向群集客户端接待员注册收件人,或者当客户端发送消息时,群集节点上尚未进行注册(竞态条件)。

如果消息到达接待员,并且没有注册这样的路径,则消息将发送到deadLetters

将节点注册到前台的过程如下所示(来自the docs的示例):

代码语言:javascript
复制
val serviceA = system.actorOf(Props[Service], "serviceA")
ClusterClientReceptionist(system).registerService(serviceA)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43775075

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档