You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Jeff MAURY <je...@jeffmaury.com> on 2015/06/27 19:17:51 UTC

[MINA3] HTTP/2 thoughts

Hello,

I am thinking about the HTTP/2 implementation we might have in MINA3 and I
want to share it with you.
As of yet, we have a basic HTTP/2 layer that just encode and decode HTTP/2
frames. This is not enough as the user has to manage the conversion between
HTTP/1.x PDUs (requests and responses) and HTTP/2 frames. No talking about
the flow control management.
We need to expose HTTP/2 streams to the user: I see to possible
implementations:

   1. transmit the stream ID in HTTP/1.x messages but this will break the
   read-only nature of the those messages as the stream ID is created when a
   new HTTP request is sent
   2. Provider an HTTP/2 view of the MINA session where the user could
   allocate streams and also receive notification for new streams (in case of
   server push). This HTTP/2 view will be provided through an helper method.

WDYT ?
Jeff

-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Re: [MINA3] HTTP/2 thoughts

Posted by Jeff MAURY <je...@jeffmaury.com>.
The idea is to provide a helper function like:

HTTP2Session http2Session = HTTP2Session.from(minaSession)

and you should call this method from a SessionCreated event.

The HTTP2Session should provide the following methods:

   - HTTP2Stream createStream();
   - void close();
   - void addHTTP2Listenener(HTTP2Listener listener);
   - and more to be discussed


Regards
Jeff

On Sun, Jun 28, 2015 at 7:45 AM, Emmanuel Lécharny <el...@gmail.com>
wrote:

> Le 27/06/15 19:17, Jeff MAURY a écrit :
> > Hello,
> >
> > I am thinking about the HTTP/2 implementation we might have in MINA3 and
> I
> > want to share it with you.
> > As of yet, we have a basic HTTP/2 layer that just encode and decode
> HTTP/2
> > frames. This is not enough as the user has to manage the conversion
> between
> > HTTP/1.x PDUs (requests and responses) and HTTP/2 frames. No talking
> about
> > the flow control management.
> > We need to expose HTTP/2 streams to the user: I see to possible
> > implementations:
> >
> >    1. transmit the stream ID in HTTP/1.x messages but this will break the
> >    read-only nature of the those messages as the stream ID is created
> when a
> >    new HTTP request is sent
> >    2. Provider an HTTP/2 view of the MINA session where the user could
> >    allocate streams and also receive notification for new streams (in
> case of
> >    server push). This HTTP/2 view will be provided through an helper
> method.
>
> I would favor the second approach. The key here would be to generate
> this notification, which should somehow fit with teh way MINA works (we
> currentlysupport a set of events, which is not extensible). Would you do
> that through the SessionCreated event ?
>
>


-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Re: [MINA3] HTTP/2 thoughts

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 27/06/15 19:17, Jeff MAURY a écrit :
> Hello,
>
> I am thinking about the HTTP/2 implementation we might have in MINA3 and I
> want to share it with you.
> As of yet, we have a basic HTTP/2 layer that just encode and decode HTTP/2
> frames. This is not enough as the user has to manage the conversion between
> HTTP/1.x PDUs (requests and responses) and HTTP/2 frames. No talking about
> the flow control management.
> We need to expose HTTP/2 streams to the user: I see to possible
> implementations:
>
>    1. transmit the stream ID in HTTP/1.x messages but this will break the
>    read-only nature of the those messages as the stream ID is created when a
>    new HTTP request is sent
>    2. Provider an HTTP/2 view of the MINA session where the user could
>    allocate streams and also receive notification for new streams (in case of
>    server push). This HTTP/2 view will be provided through an helper method.

I would favor the second approach. The key here would be to generate
this notification, which should somehow fit with teh way MINA works (we
currentlysupport a set of events, which is not extensible). Would you do
that through the SessionCreated event ?