Hi,
I have a problem detecting a failing websocket. I already got some help inside the akka issue tracker, so thanks for getting me started there even though it was the wrong place :
val source = Source.actorRef[Message](bufferSize, OverflowStrategy.fail)
val flow = Flow
.fromSinkAndSourceMat(sink, source)(Keep.right)
.alsoTo(Sink.onComplete(_ => { // Not working as expected?
println("Restarting due to Websocket failure..")
println("------------------------------------------------- \n\n\n\n")
restart()
}))
val (upgradeResponse, actor) =
Http().singleWebSocketRequest(
WebSocketRequest(
host + "/console"),
flow)
The alsoTo part never triggers, even though the websocket connection closes. I'm Testing it in this setup:
- Play Framework Server with websocket running
- Client Connects
- Messaging works
- Play Framework Server gets restarted
- Messaging fails and no Client connects
- Restarting Client manually
- Messaging works again
Best regards :)