Vert.x Http Client - http2/ with h2c headers

92 views
Skip to first unread message

Guillaume Lamirand

unread,
Feb 23, 2023, 8:26:42 AM2/23/23
to vert.x
Hi,

I am using vert.x client and I have an issue while using it with an h2c header and a flowable of Buffer. Here an extract of my code :

My client is created with those options : 

options
.setProtocolVersion(HttpVersion.HTTP_2)
.setHttp2ClearTextUpgrade(httpOptions.isClearTextUpgrade());

And I am making the request to send a Flowable of Buffer like this :
HttpClient httpClient = vertx.createHttpClient(options)
return httpClient
.rxRequest(options)
.flatMap(httpClientRequest -> {
return httpClientRequest.rxSend(request.chunks());
});

where request.chunks() is just a flowable of buffer. Nothing fancy.
I got an exception io.vertx.core.http.StreamResetException: Stream reset: 8.

Not sure if it is related to the fact that rxSend(), call send(ReadStream), that force setChunked to true. setChunked contains a check regarding the protocol version but only on HTTP1.0 not HTTP2 and chunked should be set for http/2.

// HTTP 1.0 does not support chunking so we ignore this if HTTP 1.0
if (client.options().getProtocolVersion() != io.vertx.core.http.HttpVersion.HTTP_1_0) {
this.chunked = chunked;
}

To isolate the issue to send(ReadStream), I have tested just by sending a Buffer or a String and the connection is well upgraded from HTTP1.1 to HTTP2 without issue.

Thanks
Guillaume

Guillaume Lamirand

unread,
Feb 23, 2023, 8:35:18 AM2/23/23
to vert.x
I made a typo in my original message: chunked should not be set for http/2.

Julien Viet

unread,
Mar 2, 2023, 8:30:35 AM3/2/23
to ve...@googlegroups.com
Hi,

can you test with 4.4.0 that was just released ?

Julien
> --
> 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 on the web, visit https://groups.google.com/d/msgid/vertx/2603a046-6827-41f0-8bbf-391c4e2b111bn%40googlegroups.com.

Guillaume Lamirand

unread,
Mar 2, 2023, 2:55:44 PM3/2/23
to ve...@googlegroups.com
Hi,

Thanks for your answer. Unfortunately, I have the same issue with 4.4.0.

Guillaume

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/vQ0XFX9hTt4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/CA%2BH-X4-UDDY6gV4FUPXiJNtu76cw3vGtuRnpRHcqRcVjLjsnnw%40mail.gmail.com.

Guillaume Lamirand

unread,
May 28, 2024, 4:20:48 AMMay 28
to vert.x
Hi there,

I still face the issue regarding http1 and http2 upgrades using Flowable of Buffer. Do you have any updates on this?
Thank you

Guillaume Lamirand

unread,
May 31, 2024, 4:55:16 AMMay 31
to vert.x
In addition, I have noticed an issue when the request is upgraded from HTTP 1.1 to HTTP2. It seems that an empty body is added to the request even if there is no body on the original request.

Julien Viet

unread,
Jun 4, 2024, 9:02:32 AMJun 4
to ve...@googlegroups.com
Hi,

is there a reproducer you could give us to have a deeper and more
thorough look of the issue ?

thanks

Julien
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/1ce7ed17-8941-4230-9f8b-3d849a4bf9can%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages