JEP 110 HTTP 2 client API

Kasper Nielsen kasperni at gmail.com
Wed Apr 1 17:34:47 UTC 2015


Looks really clean and simple.

Some minor issues.
1)
Would it possible to add a connect timeout parameter.
builder.setConnectTimeout(long timeout, TimeUnit unit)

For some reason it was left out of the javax.websocket API. And working
around it is a serious PITA.

2)
Rename Websocket to WebsocketClient to avoid people thinking you can use it
server side?

3)
How is the threading done for something like asynchronous connect?

4)
I find the use of byte[] vs ByteBuffer a bit inconsistent.
For example, HttpResponseBodyProcessor uses ByteBuffer while
WebSocketMessage uses byte[]

- Kasper

On Tue, Mar 31, 2015 at 6:31 PM, Michael McMahon <
michael.x.mcmahon at oracle.com> wrote:

> Hi,
>
> [this has already been posted to net-dev]
>
> JEP 110 HTTP 2 client
>
> in JDK 9, is defining and implementing a new API for HTTP which also
> supports
> the new HTTP version 2 that has recently been working its way through the
> IETF.
> The work also includes support for websockets (RFC 6455).
>
> In fact, the majority of the API is agnostic about the HTTP protocol
> version, with only minor
> configuration settings, and support for multiple responses (Http server
> push) having any direct impact.
>
> The HTTP API is defined around three main types (HttpClient, which is the
> central
> point for configuration of SSL, executor service cookie management etc),
> HttpRequest
> and HttpResponse (which should be self explanatory).
>
> Requests are sent/received either synchronously (blocking) or in a
> non-blocking (asynchronous)
> mode using java.util.future.CompletableFuture.
>
> The API docs can be seen at the link below:
>
> http://cr.openjdk.java.net/~michaelm/httpclient/01/
>
> All new classes and interfaces belong to the java.net package.
>
> A prototype implementation of this API supporting HTTP/1.1, is available
> in the JDK 9 sandbox forest in JEP-110-branch.
>
> Comments welcome!
>
> Thanks,
> Michael.
>



More information about the core-libs-dev mailing list