jQuery in Action, 2nd edition*
The moose likes Scala and the fly likes Scala Actor send/ask failure while sending message from within callback/curried function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Scala
Bookmark "Scala Actor send/ask failure while sending message from within callback/curried function" Watch "Scala Actor send/ask failure while sending message from within callback/curried function" New topic
Author

Scala Actor send/ask failure while sending message from within callback/curried function

Khuma Chhakchhuak
Ranch Hand

Joined: Nov 30, 2012
Posts: 37

The error that I got is like:

[INFO] [02/26/2014 17:56:28.472] [application-akka.actor.default-dispatcher-17] [akka://application/deadLetters] Message [models.service.ServiceBuckets] from Actor[akka://application/user/$v#-1897069859] to Actor[akka://application/deadLetters] was not delivered. [1] 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'.

Has anyone come across this kind of error?
Khuma Chhakchhuak
Ranch Hand

Joined: Nov 30, 2012
Posts: 37

Well, I am answering my own question but it is not perfect though.

The sender needs to be assinged to a "val" and then send/pass on necessary message to the new "val sender".

//Pseudocode -

val newSender = sender
someCallBackCurryFun {
// Some processing
newSender ! "Some message here" // newSender rather than sender here..
}

Wondering if someone else might have a better idea on this?
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1610
    
  13

Thanks for posting your own answer - seems like you are the local Akka expert!

I know almost nothing about Akka, but I just looked in Akka Concurrency by Derek Wyatt, where he mentions (p.102) that the dead letter office is used as a default sender if you don't provide one. Also, it says in there that "sender" is actually a method, not a value, which might be why you need to create the val newSender in order to access the sender instance from an incoming message, then use this newSender value for your next message.

The dead letter log messages may or may not be a sign of a problem according to this documentation.

Anybody else out there know enough Akka to help Khuma properly here?


No more Blub for me, thank you, Vicar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scala Actor send/ask failure while sending message from within callback/curried function
 
Similar Threads
Query regarding Unread messages in the Queue
Scala + Akka Vs Java Thread
Change Itenerary Sequence Diagram Question
Use case diagram for interfacing external system
IBM question - Chef