Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Streaming HTTP request with Webclient blocks

137 views
Skip to first unread message

hora...@gmail.com

unread,
Jan 28, 2025, 5:52:45 AMJan 28
to vert.x

Hello,

I am attempting to stream a large HTTP request between my Vert.x services. For this purpose, I am using io.vertx.reactivex.ext.web.client.WebClient (created with HttpEndpoint.rxGetWebClient(serviceDiscovery, rec ->rec.getName().equals(serviceName), webClientOptions)), which takes a Flowable as input for the rxSendStream method. 

The Flowable in question is based on a ReplaySubject populated with buffers generated by another method.

However, I have encountered an issue where the other service does not receive all the buffers. Specifically:

  1. The HTTP request appears to emit a certain number of buffers and then blocks, leaving the request incomplete.

  2. On the consumer side, fewer buffers are received than expected, and the process becomes stuck without completing the request.

I have tested the behavior with Flowable directly (without using ReplaySubject), and the result appears to be the same.

Could this issue be related to how WebClient handles backpressure? Is it possible that the backpressure handling mechanism is causing the request to block?

I am using the following snipets of the code :

```

var subject = ReplaySubject.<Buffer>create(); var flowableStream = subject.toFlowable(BackpressureStrategy.BUFFER);

 ... 

 var request = webClient.put(SERVICE_PATH) .putHeader(CONTENT_TYPE.toString(),APPLICATION_JSON); 

 setOptionalParameters(httpServerRequest, request); return 

request.as(BodyCodec.buffer()) .expect(RESPONSE_CREATED_PREDICATE).rxSendStream(flowableStream).ignoreElement().doOnComplete(() -> LOG.info("executed successfully")); 

 ... 

 subject.onNext(...)

```

thank you for any help

Thomas SEGISMONT

unread,
Jan 29, 2025, 8:46:34 AMJan 29
to ve...@googlegroups.com
Hi,

Would you mind sharing a small reproducer with us please?

Thank you

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/vertx/b2e3e909-4812-43fa-8373-5fc06b8ccd0en%40googlegroups.com.

Michael Horák

unread,
Jan 30, 2025, 9:02:30 AMJan 30
to ve...@googlegroups.com
sure, here is the reproducer: https://github.com/horak90/webclient_reproducer

Please keep me update on the issue

Thank you,
Michael

st 29. 1. 2025 v 14:46 odesílatel Thomas SEGISMONT <tsegi...@gmail.com> napsal:
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/jOLlv7Pl23g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/vertx/CACiEr_QpRTW9-DxxUJyLukO7u3cH06fYA74cdhwpA%3DrzLgQHMA%40mail.gmail.com.

hora...@gmail.com

unread,
Feb 10, 2025, 3:28:42 AMFeb 10
to vert.x
Hello,

could you please provide an update on the issue status? Additionally, if there are any workarounds to stream Flowable, I’d appreciate it, as this is currently blocking me.

Thank you,
Michael

Dne čtvrtek 30. ledna 2025 v 15:02:30 UTC+1 uživatel Michael Horák napsal:

hora...@gmail.com

unread,
Mar 7, 2025, 3:02:53 PMMar 7
to vert.x
Hello, could you please let me know if there any news on this topic

Thanks

Dne pondělí 10. února 2025 v 9:28:42 UTC+1 uživatel hora...@gmail.com napsal:

Thomas SEGISMONT

unread,
Mar 24, 2025, 5:45:21 AMMar 24
to ve...@googlegroups.com
Hi,

I haven't been able to look at the reproducer. I will look into it today.

Regards,
Thomas

Thomas SEGISMONT

unread,
Mar 24, 2025, 5:48:04 AMMar 24
to ve...@googlegroups.com
I just noticed this is now tracked by https://github.com/vert-x3/vertx-web/issues/2725

The conversation will continue there
Reply all
Reply to author
Forward
0 new messages