我正在编写简单的喷雾客户端代码:
// ActorSystem("main-actor-system") initialized earlier in code
implicit val system = actorSystem
implicit val execctx: scala.concurrent.ExecutionContext = system.dispatcher
implicit val timeout = Timeout(10.seconds)
val pipeline: Future[pipelining.WithTransformerConcatenation[HttpRequest, Future[String]]] =
for ( Http.HostConnectorInfo(connector, _) <-
IO(Http) ? Http.HostConnectorSetup("myservicehost", port = 80)
) yield sendReceive(connector) ~> unmarshal[String]
Await.ready(pipeline, 10 seconds)
// this is quite brute forse, what is better way?
val pl = pipeline.value.get.get
val response: Future[String] = pl { Get("/status")}
private val result: String = Await.result(response, 10 seconds)
response.foreach(r => println("result" + result))
每次我运行这段代码时,我都会得到
[INFO] [02/17/2016 15:31:15.596] [main-actor-system-akka.actor.default-dispatcher-3] [akka://main-actor-system/system/IO-TCP/selectors/$a/0] Message [akka.io.Tcp$Close$] from Actor[akka://main-actor-system/user/IO-HTTP/group-0/0#-1771046370] to Actor[akka://main-actor-system/system/IO-TCP/selectors/$a/0#1352725834] 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'.
我应该怎么做才能解决这个问题?