score:20
Accepted answer
The reason is because the value of 'sender' (which is a method that retrieves the value) is no longer valid after leaving the receive block, yet the future that is being used in the above example will still be running and by the time that it finishes the actor will have left the receive block and bang; an invalid sender results in the message going to the dead letter queue.
The fix is to either not use a future, or when combining futures, actors and sender then capture the value of sender before you trigger the future.
val s = sender
val responseFuture = get(lastrun)
responseFuture.onSuccess {
....
s ! time
}
Source: stackoverflow.com
Related Query
- Akka Dead Letters with Ask Pattern
- How to respond to an Ask pattern with a failure using Akka TestKit?
- Does the ask pattern work with Akka IO actors?
- Scala Akka actors, ask pattern, dead letters encountered while sending reply
- Akka Ask Pattern with many types of responses
- akka streams with spark streaming: messages are not delivered to actor; getting dead letters
- Akka - use actorSelection with ask pattern
- How to use stackable trait pattern with Akka actors?
- How to view akka dead letters
- How to handle exception with ask pattern and supervision
- The actor pattern with Akka and long running processes
- Akka Ask with Timed Retry
- When to use Ask pattern in Akka
- Akka actor - sender points to dead letters
- Example of ask pattern in akka typed
- Akka Actors: ask pattern vs Promise
- Akka Routing: Reply's send to router ends up as dead letters
- How to use the Akka ask pattern without blocking
- Dead letters in akka remoting (scala)
- Ask Pattern in Akka
- Subscribing multiple actors to Dead Letters in Akka
- Dead letters encountered in Akka when routing between sibling Actors
- Akka Remoting: Dead Letters after enabling Serialization
- PoisonPill causes dead letters with persistent actor
- Response in akka using ask pattern
- Spray route with ask pattern expects ToResponseMarshallable
- Akka Classic Ask pattern. How does it match asks with responses?
- How to test ask pattern with fallback
- Dead letters using Akka HTTP client and Akka Streams
- Dead Letters using Akka to create a message ring
More Query from same tag
- Exception while executing in Scala-Spark - java.lang.NumberFormatException: For input string: "volume"
- Flink migration: BucketingSink[T] to StreamingFileSink[T]
- Trying to implement a Circular Enumeration in Scala
- println in scala for-comprehension
- Akka Streams ActorRefSource order of messages
- Scala for loop on Seq of objects within Object
- Adding new column using existing one using Spark Scala
- Filter RDD's csv with JSON field using Spark/Scala
- how to replace last digit only in a string using scala
- Creating immutable instances and modifying copies in an idiomatic way
- Akka Scala Camel. Exception handling
- Does Scalatest provider a matcher for NaN?
- intellij - Which Scala project do I create, Scala-Scala or Scala-SBT?
- How to use RowMatrix.columnSimilarities (similarity search)
- scala not on path after installing typesafe-stack on Ubuntu
- specs2: Moving common Given into superclass
- Dependency not found in Scala
- What is coming up for scala in 2.10?
- Pattern Matching Assignment in Scala
- scala - get total at the end of summation
- Akka: How to start a simple local cluster?
- Why is a return statement required to allow this while statement to be evaluated properly?
- Instant evaluation in scala
- Transforming a scala list based on condition
- how to iterate over array[string] in spark scala?
- Scala String vs java.lang.String - type inference
- Configure Avro file size written to HDFS by Spark
- How to add tracing within a 'for' comprehension?
- Iterate the row in dataframe based on the column values in spark scala
- Sbt-assembly, Ivy, classpath