(Akka) Resend DeadLetter in DeadLetter Queue

I am thinking of creating an Actor maybe named FooActor that subscribes to the deadletter queue and attempts to resend those messages. I cannot afford to resend those messages as FooActor. The sender field should be coming from the DeadLetter object sender field.

Is there any way to send a message “as another Actor” or any way to tweak the sender field of a message sent?

Both tell and ask have “sender” parameters, and a DeadLetter contains the original sender ActorRef, so it should be possible to do something like:

case DeadLetter(message, sender, recipient) => recipient ! (message)(sender)
or
case DeadLetter(message, sender, recipient) => recipient ? (message)(timeout, sender)

Hope this helps.
Brian

2 Likes

Thank you very much, i didn’t know one can do this