Hi Vadim,

the Persistent message serializer (part of akka-persistence) tries to resolve the sender reference that is stored together with the Persistent message in the journal. A resolve attempt is made during deserialization which happens during replay.

The stored sender is the top actor and there's a new incarnation on each application run. You can safely ignore this debug output. Should you want that your workers reply to the current incernation of the top actor, use channels and sender resolution <http://doc.akka.io/docs/akka/2.3-M2/scala/persistence.html#sender-resolution>. This feature was made exactly for this purpose.

Cheers,
Martin

On 04.01.14 18:16, Vadim Bobrov wrote:
Hi Martin,

I am not using channels, just processors and persistent messages. Here is the code

object Main extends App {

val config = ConfigFactory.load().getConfig("evsourd")
implicit lazy val system = ActorSystem("evsourd", config)

val top = system.actorOf(Props[TopActor], name = "top")


for(i <- 1 to 10)
top ! i

}

class TopActor extends Actor with ActorLogging {

var workers = Map.empty[Int, ActorRef]

override def receive = {

case n: Int =>
if(!workers.contains(n % 4))
workers += (n % 4 -> context.actorOf(Props[Worker], name = "worker" + (n % 4)))

   workers(n % 4) ! Persistent(n)

}

}

class Worker extends Processor with ActorLogging {

override def processorId = self.path.name


override def receive = {

case Persistent(payload: Int, sequenceNr) =>
if(recoveryRunning)
log.debug("recovery message " + payload)
else
log.debug("new message " + payload)



}

}

Thanks
Vadim
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

--
Martin Krasser

blog:    http://krasserm.blogspot.com
code:    http://github.com/krasserm
twitter: http://twitter.com/mrt1nz

--
     Read the docs: http://akka.io/docs/
     Check the FAQ: http://akka.io/faq/
     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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to