1

我正在使用 janus 网关,当我从浏览器点击时,它的路由工作正常

http://192.168.1.4:8088/janus/info

但代码抛出异常这是我的代码

val responseFuture: Future[HttpResponse] = Http().singleRequest(HttpRequest(uri = "http://192.168.1.4:8088/janus/info"))
    
  responseFuture
      .onComplete {
        case Success(res) => println("we got http response" + res)
          log.info("get session id response " + Unmarshal(res).to[String])
          val strJson = Unmarshal(res).to[String]
        case Failure(e: Exception) => log.error("something wrong", e)
      }
  }

这是我得到的例外

[info] Running janusgateway.rest.GetStartedWithJanus 
18:13:21.169 734 [default-akka.actor.default-dispatcher-4] Slf4jLogger INFO - Slf4jLogger started
we got http responseHttpResponse(200 OK,List(Connection: Keep-Alive, Access-Control-Max-Age: 86400, Access-Control-Allow-Origin: *, Date: Wed, 02 Sep 2020 13:13:22 GMT),HttpEntity.Chunked(application/json),HttpProtocol(HTTP/1.1))
18:13:22.451 2016 [default-akka.actor.default-dispatcher-5] GetStartedWithJanus$ INFO - get session id response Future(<not completed>)
java.lang.IllegalStateException: Substream Source cannot be materialized more than once
    at akka.stream.impl.fusing.SubSource$$anon$13.setCB(StreamOfStreams.scala:792)
    at akka.stream.impl.fusing.SubSource$$anon$13.preStart(StreamOfStreams.scala:802)
    at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:306)
    at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:593)
    at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:701)
    at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:750)
    at akka.actor.Actor.aroundPreStart(Actor.scala:545)
    at akka.actor.Actor.aroundPreStart$(Actor.scala:545)
    at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:690)
    at akka.actor.ActorCell.create(ActorCell.scala:637)
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:509)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:531)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:294)
    at akka.dispatch.Mailbox.run(Mailbox.scala:229)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:242)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

我已经在我的本地机器上部署了 janus,我是它的初学者,上面的异常似乎 janus 没有响应请求

4

0 回答 0