score:0

Accepted answer

the problem is in your sink. that sink.head will return one element from your materialized stream. so the question is, why it´s received more than one value when mapasync(>1) is used in stream materialization?. maybe it´s because it uses more than one actor pushing values downstream.

in any case, change your sink to something like:

val sink: sink[string, future[string]] = sink.fold("")((a, b) => b ++ a)

and it will work.


Related Query

More Query from same tag