java - How to respond with the result of an actor call? -
we looking @ using akka-http java api - using routing dsl. it's not clear how use routing functionality respond httprequest; using untyped akka actor. example, upon matching route path, how hand off request "handler" actorref, respond httpresponse in asynchronous way? a similar question posted on akka-user mailing list, no followup solutions such - https://groups.google.com/d/msg/akka-user/qhe3ko7evvg/kc-akz_o5aoj . this can accomplished combination of oncomplete directive , ask pattern. in below example requesthandleractor actor used create httpresponse based on httprequest . actor asked within route. i have never used java routing code response in scala. import scala.concurrent.duration._ import akka.actor.actorsystem import akka.http.scaladsl.model.httpresponse import akka.http.scaladsl.model.httprequest import akka.actor.actor import akka.http.scaladsl.server.directives._ import akka.actor.props import akka.pattern.ask import akka.util.timeo...