You use noSender in ActorA when sending START. Use self instead.
/Patrik
tors 29 sep. 2016 kl. 19:20 skrev <ques...@gmail.com>:

> On Wednesday, September 28, 2016 at 1:55:42 PM UTC-7, que...@gmail.com
> wrote:
>>
>> 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?
>>
>
> 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.
>
> --
> >>>>>>>>>> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to