Hi,

I am making several requests to a particular endpoints. The endpoint calls 
some remote db and can take up to several seconds. That's why I am wrapping 
requests in Future, not to block the main actor. But second or third 
requests are failing with the following in the log:

SelectionHandler - Monitored actor 
[Actor[akka://default/system/IO-TCP-STREAM/server-1-%2F0.0.0.0%3A9000/$i#-657437010]]
 
terminated

The init code is pretty trivial:

object Main extends App with Logging {
  implicit val system: ActorSystem = ActorSystem()
  implicit def executor: ExecutionContextExecutor = system.dispatcher
  implicit val materializer: Materializer = ActorMaterializer()


  val defaultEndpoint = new HistoryApiEndpoint {
    override implicit val context: ExecutionContext = executor
  }

  val routes = defaultEndpoint.routes

  Http().bindAndHandle(routes, "0.0.0.0", 9000)
}


The endpoint code is pretty simple as well:

implicit val context: ExecutionContext


val routes = get {
  path("test") {
    val deviceId = UUID.fromString(deviceIdStr)
      complete {
        Future {
          *// make blocking call here that returns an objec*
        }
      }
    }
  } 


Thank you!

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to