Akka Streams buffer on SubFlows based on parent Flow

79 views Asked by At

I am using akka-streams and I hit an exception because of maxing out the Http Pool on akka-http. There is a Source of list-elements, which get split and thus transformed to SubFlows. The SubFlows issue http requests. Although I put a buffer on the SubFlow, it seems the buffer takes effect per SubFlow. Is there a way to have a buffer based on the Source that takes effect on the SubFlows?

1

There are 1 answers

0
gkatzioura On BEST ANSWER

My mistake was that I was merging the substreams without taking into consideration the parallelism by using

def mergeSubstreams(): Flow[In, Out, Mat] 

From the documentation

This is identical in effect to mergeSubstreamsWithParallelism(Integer.MAX_VALUE).

Thus my workaround was to use

def mergeSubstreamsWithParallelism(parallelism: Int): Flow[In, Out, Mat]