Hi,
My code is as following:
In API:
ServiceCall(NotUsed,Source<String,?>> getTime(int intervalMs);
pathCall(“/api/getTime/:duration”, this::getTime)
In implementation:
@Override
public ServerServiceCall<NotUsed, Source<String, ?>> getTime(int intervalMs){
return request → {
System.out.println(“Time interval:”+ intervalMs);
Duration interval = Duration.ofMillis(intervalMs);
return completedFuture(Source.tick(interval, interval, Long.toString(System.currentTimeMillis())));
};
}
When I make call: http://localhost:9000/api/getTime/3000
I get error:
akka.http.impl.util.One2OneBidiFlow$OutputTruncationException: Inner flow was completed without producing result elements for 1 outstanding elements
at akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$.apply(One2OneBidiFlow.scala:22)
at akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$.apply(One2OneBidiFlow.scala:22)
What causes such an issue?