There is a scheduled timeout in PersistentActor. That might be the reason
and you could try increase the timeout (look in reference.conf in
akka-persistence).

In general, it can be difficult to do breakpoint debugging with actors,
since so many things may happen concurrently and might depend on that the
actors are responsive.

println is primitive but always works ;-)

/Patrik


fre 31 mars 2017 kl. 12:06 skrev Jozsef Hegedus <[email protected]>:

> Originally I decided not to copy here the question because that is more
> DRY but if it is considered nicer to copy the SOF question, of course can
> do that, no problem.
>
> The question from SOF :
>
> If I set a breakpoint here
> <https://github.com/akka/akka-samples/blob/master/akka-sample-persistence-scala/src/main/scala/sample/persistence/PersistentActorExample.scala#L29>
> :
>
> package sample.persistence
> //#persistent-actor-exampleimport akka.actor._import akka.persistence._
> case class Cmd(data: String)case class Evt(data: String)
> case class ExampleState(events: List[String] = Nil) {
>   def updated(evt: Evt): ExampleState = copy(evt.data :: events)
>   def size: Int = events.length
>   override def toString: String = events.reverse.toString}
> class ExamplePersistentActor extends PersistentActor {
>   override def persistenceId = "sample-id-1"
>
>   var state = ExampleState()
>
>   def updateState(event: Evt): Unit =
>     state = state.updated(event)
>
>   def numEvents =
>     state.size
>
>   val receiveRecover: Receive = {
>     case evt: Evt                                 => updateState(evt)
>     case SnapshotOffer(_, snapshot: ExampleState) => state = snapshot
>                                                   ^^^^^^^ BREAKPOINT ^^^^^
>   }
>
>   val receiveCommand: Receive = {
>     case Cmd(data) =>
>       persist(Evt(s"${data}-${numEvents}"))(updateState)
>       persist(Evt(s"${data}-${numEvents + 1}")) { event =>
>         updateState(event)
>         context.system.eventStream.publish(event)
>       }
>     case "snap"  => saveSnapshot(state)
>     case "print" => println(state)
>   }
> }//#persistent-actor-example
> object PersistentActorExample extends App {
>
>   val system = ActorSystem("example")
>   val persistentActor = system.actorOf(Props[ExamplePersistentActor], 
> "persistentActor-4-scala")
>
>   persistentActor ! Cmd("foo")
>   persistentActor ! Cmd("baz")
>   persistentActor ! Cmd("bar")
>   persistentActor ! "snap"
>   persistentActor ! Cmd("buzz")
>   persistentActor ! "print"
>
>   Thread.sleep(10000)
>   system.terminate()}
>
>
> then I get:
>
> [INFO] [03/30/2017 22:53:40.141] [example-akka.actor.default-dispatcher-3] 
> [akka://example/user/persistentActor-4-scala] Message [java.lang.String] from 
> Actor[akka://example/deadLetters] to 
> Actor[akka://example/user/persistentActor-4-scala#-1598116294] 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'.[INFO] [03/30/2017 22:53:40.142] 
> [example-akka.actor.default-dispatcher-3] 
> [akka://example/user/persistentActor-4-scala] Message 
> [sample.persistence.Cmd] from Actor[akka://example/deadLetters] to 
> Actor[akka://example/user/persistentActor-4-scala#-1598116294] was not 
> delivered. [2] 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'.[INFO] [03/30/2017 22:53:40.142] 
> [example-akka.actor.default-dispatcher-3] 
> [akka://example/user/persistentActor-4-scala] Message 
> [sample.persistence.Cmd] from Actor[akka://example/deadLetters] to 
> Actor[akka://example/user/persistentActor-4-scala#-1598116294] was not 
> delivered. [3] 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'.[INFO] [03/30/2017 22:53:40.142] 
> [example-akka.actor.default-dispatcher-3] 
> [akka://example/user/persistentActor-4-scala] Message 
> [sample.persistence.Cmd] from Actor[akka://example/deadLetters] to 
> Actor[akka://example/user/persistentActor-4-scala#-1598116294] was not 
> delivered. [4] 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'.[INFO] [03/30/2017 22:53:40.142] 
> [example-akka.actor.default-dispatcher-3] 
> [akka://example/user/persistentActor-4-scala] Message [java.lang.String] from 
> Actor[akka://example/deadLetters] to 
> Actor[akka://example/user/persistentActor-4-scala#-1598116294] was not 
> delivered. [5] 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'.[INFO] [03/30/2017 22:53:40.142] 
> [example-akka.actor.default-dispatcher-9] 
> [akka://example/user/persistentActor-4-scala] Message 
> [sample.persistence.Cmd] from Actor[akka://example/deadLetters] to 
> Actor[akka://example/user/persistentActor-4-scala#-1598116294] was not 
> delivered. [6] 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'.[INFO] [03/30/2017 22:53:40.143] 
> [example-akka.actor.default-dispatcher-9] 
> [akka://example/user/persistentActor-4-scala] Message [java.lang.String] from 
> Actor[akka://example/deadLetters] to 
> Actor[akka://example/user/persistentActor-4-scala#-1598116294] was not 
> delivered. [7] 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'.Disconnected from the target VM, 
> address: '127.0.0.1:53432', transport: 'socket'
> Process finished with exit code 0
>
>
>
>    -
>
>    Why is this happening ?
>    -
>
>    Why do I get dead letters ?
>    -
>
>    Is it because the messages time out ?
>    -
>
>    If yes, is there a way to set the timeout interval to infinite ?
>    -
>
>    If the reason is something else then is there a way to make sure that
>    no dead letters will turn up due to debugging using breakpoints ?
>
>
>
> On Fri, Mar 31, 2017 at 12:49 PM, Konrad Malawski <
> [email protected]> wrote:
>
> Sure, it is the community - so please be nice to it :-)
> It is not nice to go over all possible channels just sending links to
> stack overflow.
>
> At least re state your question or that you did not get an answer there
> etc.
> Asking for help works better if you're nice about it.
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 31 March 2017 at 11:44:50, Jozsef Hegedus ([email protected]) wrote:
>
> Thanks for the info.
>
> I don't really know what is the connection between Akka and Lightbend.
>
> I was thinking this is a community Akka channel and not a commercial
> channel for advertising Lightbend, or is it ?
>
> On Fri, Mar 31, 2017 at 12:40 PM, Konrad Malawski <
> [email protected]> wrote:
>
> Hi Jozsef, when cross-posting at least take the effort to copy the
> message...
> Just posting more links via more channels seems very "nagging".
>
> If you want ASAP answers we offer commercial support, otherwise please be
> nice and patient when asking the community for help.
> Thanks for your understanding.
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 30 March 2017 at 22:52:38, Jozsef Hegedus ([email protected]) wrote:
>
> Why do I get dead letters when trying to debug akka actor using a
> breakpoint?
>
>
> http://stackoverflow.com/questions/43127370/why-do-i-get-dead-letters-when-trying-to-debug-akka-actor-using-a-breakpoint
>
>
> --
> >>>>>>>>>> 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 [email protected].
> To post to this group, send email to [email protected].
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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 [email protected].
To post to this group, send email to [email protected].
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