2017-05-04 53 views
0

我试图通过ClusterClient发送简单字符串"Dummy string"到Akka集群。设置正常,我得到前端和集群连接,但发送到消息发送到DistributedPubSub调解员从ClusterReceptionist发送到DeadLetters来自`ClusterReceptionist`的消息没有达到`DistributedPubSubMediator`

如果我安排另一个Send消息在一段时间之后从集群内发送到中介器,它将起作用。

请帮忙,提前谢谢。

前端日志:

22:51:34,645 DEBUG akka.remote.EndpointWriter - sending message RemoteMessage: [Send(user/UserServiceProxy,Dummy string,true)] to [Actor[akka.tcp://[email protected]:2552/system/receptionist#-1744655285]]<+[akka.tcp://[email protected]: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] 

群集日志:

22:51:34,626 DEBUG akka.remote.EndpointWriter - sending message RemoteMessage: [ActorIdentity([[email protected],Some(Actor[akka://PvpCluster/system/receptionist#-1744655285]))] to [Actor[akka.tcp://[email protected]:3000/user/cluster-client#-2107174838]]<+[akka.tcp://[email protected]: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://[email protected]:3000/deadLetters]()] 
22:51:34,657 DEBUG akka.cluster.client.ClusterReceptionist$Internal$ClientResponseTunnel - started (akka.c[email protected]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://[email protected]:3000/user/cluster-client#-2107174838]()] 
22:51:36,440 DEBUG akka.cluster.client.ClusterReceptionist - Received new contact from [akka.tcp://[email protected]:3000/user/cluster-client] 
22:51:36,440 DEBUG akka.remote.EndpointWriter - sending message RemoteMessage: [HeartbeatRsp] to [Actor[akka.tcp://[email protected]:3000/user/cluster-client#-2107174838]]<+[akka.tcp://[email protected]:3000/user/cluster-client] from [Actor[akka://PvpCluster/system/receptionist#-1744655285]] 
22:51:36,837 DEBUG akka.remote.transport.ProtocolStateActor - stopped 

回答

0

很难确定到底没有看到代码,但通常会发生这种情况,因为你已经忘记了注册收件人集群客户端接待员,或当客户端发送消息(竞争条件)时群集节点上的注册尚未发生。

如果邮件到达接待员,并且没有注册此类路径,邮件将发送到deadLetters

注册节点向接待员像这样做(从the docs样品):

val serviceA = system.actorOf(Props[Service], "serviceA") 
ClusterClientReceptionist(system).registerService(serviceA) 
相关问题