akka http client system.shutdown()产生"传出请求流错误(akka.stream.AbruptTerminationException)"使用https时

时间:2017-02-11 21:21:52

标签: akka-stream akka-http

您好以下代码按预期工作。

implicit val system = ActorSystem()
implicit val materializer = ActorMaterializer()

import system.dispatcher

val request = HttpRequest(uri = "http://www.google.com")

Http.get(system).singleRequest(request).map(_.entity.dataBytes.runWith(Sink.ignore))
  .onComplete { _ =>
    println("shutting down actor system...")
    system.terminate()
  }

但是,如果我将http://www.google.com更改为https://www.google.com,请执行以下操作:

implicit val system = ActorSystem()
implicit val materializer = ActorMaterializer()

import system.dispatcher

val request = HttpRequest(uri = "https://www.google.com")

Http.get(system).singleRequest(request).map(_.entity.dataBytes.runWith(Sink.ignore))
  .onComplete { _ =>
    println("shutting down actor system...")
    system.terminate()
  }

我收到以下错误消息:

shutting down actor system...
[ERROR] [02/11/2017 13:13:08.929] [default-akka.actor.default-dispatcher-4] [akka.actor.ActorSystemImpl(default)] Outgoing request stream error (akka.stream.AbruptTerminationException)

任何人都知道为什么https会产生上述错误,我该如何解决?

1 个答案:

答案 0 :(得分:4)

这显然是一个已知问题,请参阅以下门票:

错误似乎无害。