Btw. it seems your stream graph is a simple linear one. In that case you don’t need any GraphDSL but can use the simpler style using via to combine Flows:
val exasolAnnounce = http
.webSocketClientFlow(WebSocketRequest(socketUrl))
.named("ExasolAnnounceLogin")
.log("SendAnnounce")
val announceResponse = Flow[Message].map(data =>
LoginCommand.Response.extract(data)
).named("Building Response").log("AnnouncementResponse")
val loginMessage = TextMessage((new LoginCommand).toJsonString())
val wsSource =
Source.single(loginMessage)
.via(exasolAnnounce)
.via(announceResponse)
Maybe it was part of the problem. As this is a race condition there may have been many causes, but the ultimate problem is still the one I linked above
It’s your own Source.single which finishes the outgoing side of the websocket client connection after it sent the first message.
Interesting.
Btw. it seems your stream graph is a simple linear one.
Nope. The resulting stream graph has stuff like fan ins and such.
Besides I have not read a comprehensive explanation of Materialization yet - so graphs are easier for me to comprehend (I think).
but the ultimate problem is still the one I linked above
Correct. Took me a while to understand.
Soo one workaround could be to have a Source.maybe at the end of the stream and produce a dummy value shortly before? Or how would you prevent the Source from closing until all Websocket requests were done?