Large streaming request body without loading the entire request into memory

48 views
Skip to first unread message

dra...@gmail.com

unread,
Feb 21, 2019, 11:54:39 AM2/21/19
to asynchttpclient
I was surprised to find that ReactiveStreamsBodyGenerator.SimpleSubscriber.onSubscribe calls subscription.request(Long.MAX_VALUE), as this will cause the Publisher to publish chunks as fast as possible, leading to an unbounded growth of the queue in the underlying BodyGenerator.  If the request content can be generated much quicker than it can be sent, this can definitely cause problems.  I was expecting the reactive streams implementation to only request new chunks once the previous chunk had been transmitted.  Am I missing something, or is there some other way to apply back-pressure to the body input?  If not, it wouldn't be terribly complicated to create a new BodyGenerator with the desired behavior.

Stéphane LANDELLE

unread,
Feb 21, 2019, 12:14:09 PM2/21/19
to asyncht...@googlegroups.com
I no longer actively maintain this project, all the more the reactive streams part that was purely a contribution.
Contributions welcome.

Stéphane Landelle
GatlingCorp CTO



On Thu, Feb 21, 2019 at 5:54 PM dra...@gmail.com <dra...@gmail.com> wrote:
I was surprised to find that ReactiveStreamsBodyGenerator.SimpleSubscriber.onSubscribe calls subscription.request(Long.MAX_VALUE), as this will cause the Publisher to publish chunks as fast as possible, leading to an unbounded growth of the queue in the underlying BodyGenerator.  If the request content can be generated much quicker than it can be sent, this can definitely cause problems.  I was expecting the reactive streams implementation to only request new chunks once the previous chunk had been transmitted.  Am I missing something, or is there some other way to apply back-pressure to the body input?  If not, it wouldn't be terribly complicated to create a new BodyGenerator with the desired behavior.

--
You received this message because you are subscribed to the Google Groups "asynchttpclient" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asynchttpclie...@googlegroups.com.
To post to this group, send email to asyncht...@googlegroups.com.
Visit this group at https://groups.google.com/group/asynchttpclient.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages