vert.x
vert.x copied to clipboard
HttpClient supports request on a specified HttpConnection
Describe the feature
Allows HttpClient send a request on a specified HttpConnection.
Use cases
- for reversed proxy we could bound the client connection to upstream connection (load balance or keeping the authentication context).
Contribution
may be something like:
new io.vertx.core.http.RequestOptions()
.setConnection(HttpConnection or HttpClientConnection) // currently HttpClientConnection is defined at io.vertx.core.http.impl
currently that is something you can do if you cast HttpConnection to HttpClientConnection and use createStream() and then use the stream API directly. You can have a look at Http1xClientConnectionTest.
We could think of having a way to attach HttpClientRequest and HttpClientResponse to a stream.
the use case is to reuse the same HTTP client connection for a given HTTP server connection, is that right ?
so we could cleanup and improve the HttpClientStream API which currently uses a mix of ByteBuf and Buffer (it would use only Buffer) to make it more usable.
the use case is to reuse the same HTTP client connection for a given HTTP server connection, is that right ?
yes, that's right.
so we could cleanup and improve the
HttpClientStreamAPI which currently uses a mix ofByteBufandBuffer(it would use onlyBuffer) to make it more usable.
HttpClientStream defined at io.vertx.core.http.impl package. it seem like internal api.
could we define a simply api on HttpClient ?
HttpClientConnection would be move to the io.vertx.core.http package and provide something like Future<HttpClientRequest> HttpConnection#request() that would schedule a request on this connection, how does that sound ?
HttpClientConnectionwould be move to theio.vertx.core.httppackage and provide something likeFuture<HttpClientRequest> HttpConnection#request()that would schedule a request on this connection, how does that sound ?
LGTM, thanks.