Message not delivered log entry, after log entry of message having been delivered?

32 views
Skip to first unread message

que...@gmail.com

unread,
Sep 28, 2016, 4:55:42 PM9/28/16
to Akka User List
I have one actor that sends a message to another actor. There is a message logged that the message is sent and a message logged that it was received, then later there is a message saying that the message could not be delivered. Is this normal?

Essentially, I have (java):

ActorRef actorB = system.actorOf(Props.create(ActorB.class), "actorb");
ActorRef actorA = system.actorOf(Props.create(ActorA.class, actorB), "actora");

actorA
.tell(START, ActorRef.noSender());


ActorA's receive method:

ReceiveBuilder.matchEquals(START, ignored -> actorBRef.tell(START, self()))
                       
.matchEquals(STOP, ignored -> context().system().terminate())
                       
.build();


ActorB's receive method:

ReceiveBuilder.matchEquals(START, ignored -> {
                           
// do stuff
                            sender
().tell(STOP, self());
                            context
().stop(self());
                         
})
                       
.build();


The log shows ActorA sent START to ActorB, ActorB received START and sent STOP to ActorA. Then later the dispatcher logs a message that ActorA's START message was not delivered to ActorB.

Is ActorB supposed to do something to indicate to the dispatcher that it received the message? I am guessing it has to do ActorB teliing itself to stop. Or, why is complaining about a message not being sent after it was sent and received?

que...@gmail.com

unread,
Sep 29, 2016, 1:20:26 PM9/29/16
to Akka User List
My guess is that this is normal. I changed my code so that it sends a message that it is done without stopping itself, then when it receives a message to stop itself it stops without also sending a message. So, there is no longer a message from the actor, in transit (maybe), while it is stopping itself.

I would still like to understand how the dispatcher saw a message as undelivered after it had been received.

Patrik Nordwall

unread,
Oct 1, 2016, 2:19:59 PM10/1/16
to Akka User List
You use noSender in ActorA when sending START. Use self instead.
/Patrik
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages