Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Khuma Chhakchhuak
Ranch Hand
Posts: 37
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2407
32
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Philippe Jean
Greenhorn
Posts: 1
IntelliJ IDE Mac OS X Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not an error, just an info and you can disable it in the application.conf, just add:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic