首页 > 解决方案 > Akka http 传出连接卡住

问题描述

调用下面的 httpConnection 既不会返回 Flow[HttpRequest, HttpResponse, Future[Http.OutgoingConnection]] 也不会进入 catch 块。它只是卡住了。

lazy val httpConnection= Try{
    http().outgoingConnection(host,port)
}
catch{
   case e:Exception: /***Action***/
}

  httpConnection match {
      case f:Flow[HttpRequest, HttpResponse,Future[Http.OutgoingConnection]] => Source.single(request).via(flow).runWith(Sink.head)
      case e:Exception => logger("not able to get connection")
     }

标签: scalaakkaakka-http

解决方案


推荐阅读