今天早上我的代码停止了工作。现在,所有HttpResponse
都错误地发送到deadLetter
。可能是什么问题?
class MyActor extends Actor {
val mediator = DistributedPubSubExtension(context.system).mediator
def receive = {
case "tick" => {
val pipeline = sendReceive ~> unmarshal[MyItems[Id]]
val pipeline2: HttpRequest => Future[HttpResponse] = sendReceive
val responseFuture: Future[MyItems[Id]] = pipeline(Get(path))
responseFuture onComplete {
case Success(json_items: MyItems[Id]) =>
mediator.tell(DistributedPubSubMediator.Publish("I have response", ResponseTime(format.format(Calendar.getInstance().getTime())), self)
case Failure(t) => println("An error has occured: " + t.getMessage)
}
}
}
}
答案 0 :(得分:0)
问题是服务器正在发送不同的消息,而且它们无法解析为MyItems对象,因此导致错误,服务器响应被转发给了动态。