2017-05-04 7 views
0

ClusterClient을 통해 간단한 문자열 "Dummy string"을 Akka 클러스터로 보내려고합니다. 설정은 정상이며 프론트 엔드와 클러스터가 연결되어 있지만 에서 DistributedPubSub 중재자에게 전송 된 Send 메시지는 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)