SlideShare a Scribd company logo
1 of 47
Download to read offline
HTTP/2	
  Comes	
  to	
  Java
David	
  Delabassee	
  (@delabassee)	
  
Oracle
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Safe	
  Harbor	
  Statement
The	
  following	
  is	
  intended	
  to	
  outline	
  our	
  general	
  product	
  direction.	
  It	
  is	
  intended	
  for	
  
information	
  purposes	
  only,	
  and	
  may	
  not	
  be	
  incorporated	
  into	
  any	
  contract.	
  It	
  is	
  not	
  a	
  
commitment	
  to	
  deliver	
  any	
  material,	
  code,	
  or	
  functionality,	
  and	
  should	
  not	
  be	
  relied	
  upon	
  
in	
  making	
  purchasing	
  decisions.	
  The	
  development,	
  release,	
  and	
  timing	
  of	
  any	
  features	
  or	
  
functionality	
  described	
  for	
  Oracle’s	
  products	
  remains	
  at	
  the	
  sole	
  discretion	
  of	
  Oracle.
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 2
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Java	
  EE	
  8	
  
Why	
  HTTP/2?	
  
HTTP/2	
  Big	
  Features	
  
HTTP/2	
  and	
  Java	
  EE	
  
HTTP/2	
  and	
  Java	
  SE	
  
Summary
3
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Java	
  EE	
  8	
  
Why	
  HTTP/2?	
  
HTTP/2	
  Big	
  Features	
  
HTTP/2	
  and	
  Java	
  EE	
  
HTTP/2	
  and	
  Java	
  SE	
  
Summary
4
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Java	
  EE	
  8	
  -­‐	
  HTML5	
  Support	
  /	
  Web	
  Tier	
  Enhancements
• JSON	
  Binding	
  
• JSON	
  Processing	
  enhancements	
  
• Server-­‐sent	
  events	
  
• Action-­‐based	
  MVC	
  
• HTTP/2	
  support
5
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Java	
  EE	
  8	
  
Why	
  HTTP/2?	
  
HTTP/2	
  Big	
  Features	
  
HTTP/2	
  and	
  Java	
  EE	
  
HTTP/2	
  and	
  Java	
  SE	
  
Summary
6
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 7
HTTP	
  1.x
1991	
   1996	
   1999	
   2009	
   2015	
  
HTTP/0.9	
  
HTTP/1.0	
  
HTTP/1.1	
  
SPDY	
  
HTTP/2.0	
  
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 8
Back	
  then…
8
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 9
Today
index.html
style1.css
style2.css
.	
  
.	
  
.	
  
script1.js
script9.js
pic1.jpg
pic8.jpg
.	
  
.	
  
.	
  
photo1.png
photo2.png
.	
  
.	
  
.	
  
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 10
• “Conversion	
  Rate”	
  Vs.	
  Latency	
  
- If	
  a	
  page	
  takes	
  longer	
  than	
  4	
  sec	
  to	
  load,	
  1/4	
  people	
  abandons	
  that	
  page	
  
- Page	
  load	
  slowdown	
  of	
  1	
  sec	
  could	
  cost	
  Amazon	
  $1.6	
  billion	
  in	
  sales	
  each	
  year	
  
- Slowing	
  search	
  results	
  by	
  just	
  0.4	
  sec,	
  Google	
  could	
  lose	
  8	
  million	
  searches	
  per	
  day	
  
	
  (http://www.fastcompany.com/1825005/how-­‐one-­‐second-­‐could-­‐cost-­‐amazon-­‐16-­‐billion-­‐sales)
10
Time	
  is	
  Money!
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 11
google.fr	
  (1st)	
  
• 3	
  HTTP	
  Requests	
  
• 21.355	
  bytes	
  
- 1	
  HTML	
  
- 1	
  image	
  
- 1	
  .js
11
Top	
  .FR	
  examples
lefigaro.fr	
  (15th)	
  
• 140	
  HTTP	
  Requests	
  
• 2.736.562	
  bytes	
  
- 1	
  HTML	
  
- 130	
  images	
  
- 6	
  .js	
  
- 2	
  .css	
  
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
HTTP	
  1.1
Head-­‐of-­‐Line	
  blocking
12
Client Server
index.html
index.html
style1.css	
  
style2.css	
  
script1.js	
  
...
style1.css	
  
style2.css	
  
script1.js	
  
...
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 13
HTTP	
  1.1
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 14
File	
  Concatenation	
  and	
  Image	
  Sprites
14
• Modern	
  web	
  page	
  consists	
  of	
  +90	
  resources	
  fetched	
  from	
  15	
  distinct	
  
hosts	
  (http://httparchive.org)	
  
• TCP	
  Efficiency	
  Improves	
  with	
  Larger	
  Files	
  
• Shoving	
  more	
  than	
  one	
  logical	
  file	
  into	
  one	
  physical	
  file
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 15
File	
  Concatenation	
  and	
  Image	
  Sprites
15
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 16
HTTP	
  1.1
Workaround	
  -­‐	
  Domain	
  Sharding
16
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 17
Asset	
  inlining
…	
  
<img	
  src="data:image/gif;base64,R0lGODlhEAAOexs3eeALMAAOazToeHh0tLS/
7LZv0jvb29tf3Ubge8WSLrhf3kdbW1mxsjkhfkjfhGHhcjGDSHJUYgJvhgtyrHgfGfHy
t56HGfGH56ge8WSLf6GGHhfkjfhhfkjfhpBREzxvt6QAA4lsjkhfkjfhdxwqBnuIoYty
GhBKoOjJj6GGHvvhdsbxus38GV3pBREzxvt6QAA4lsjkhfkjfhdxwqBnuIoYtyGhBKoO
jJj6GGHvvhdsbxus38GV3vvhdsbxusbasbPmfyH5BAAAjAAAALAAfhGHhcjAAAAQAA4l
sjkhfkjfhGHhcjGDSHJUYgJvhgtyrHgfhfkjfhpBREzxvt6QAA4lsjkhfkjfhdxwqBnu
IoYtyGhBKoOjJj6GGHvvhdsbxus38GV3GfHyt56HGfGH56ge8WsjkhfkjfhGHhcjGDSH
JUYgJvhgtyrHgfGfHyt56HGfGH56gebxus38G8WSLf6GGHvvhdsbxusbaSLf6GGHvvhd
sbxusbaOiQA4lsjkhfkjf4lsjkhfkjf4lsjbxus38GkhfkjfhfkjfhpBREzxvt6QAA4l
sjkhfkjfhdxwqBnuIoYtyGhBKoOjJj6GGHvvhdsbxus38GV3DcPjjBceXsplojj…”	
  />	
  
…
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 18
• HTTP	
  uses	
  TCP	
  poorly	
  
- HTTP:	
  short	
  and	
  bursty	
  flows	
  Vs.	
  TCP:	
  optimized	
  for	
  long-­‐lived	
  flows	
  
• Solutions	
  
- Sprites	
  
- Domain	
  sharding	
  
- Assets	
  Inlining	
  
- File	
  concatenations	
  
- …
18
HTTP/1.1	
  circa	
  1999
Problems	
  Vs	
  Solutions
1991	
   1996	
   1999	
   2009	
   2015	
  
HTTP/0.9	
  
HTTP/1.0	
  
HTTP/1.1	
  
SPDY	
  
HTTP/2.0	
  
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Java	
  EE	
  8	
  
Why	
  HTTP/2?	
  
HTTP/2	
  Big	
  Features	
  
HTTP/2	
  and	
  Java	
  EE	
  
HTTP/2	
  and	
  Java	
  SE	
  
Summary
19
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 20
HTTP/2	
  Features
• Binary	
  Framing	
  over	
  single	
  TCP	
  connection	
  
• Request/Response	
  multiplexing	
  
• Stream	
  Prioritization	
  
• Server	
  Push	
  
• Upgrade	
  from	
  HTTP	
  1.1	
  
• Header	
  Compression
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 21
HTTP/2
• Fully	
  bi-­‐directional	
  
– Connection

A	
  TCP	
  socket	
  
– Message	
  

A	
  logical	
  HTTP	
  message,	
  such	
  as	
  a	
  request	
  or	
  a	
  response	
  	
  
– Stream

A	
  bi-­‐directional	
  “channel”	
  within	
  a	
  connection,	
  carry	
  one	
  or	
  more	
  message	
  
– Frame

The	
  smallest	
  unit	
  of	
  communication	
  in	
  HTTP/2
21
Lets	
  you	
  do	
  more	
  things	
  with	
  a	
  single	
  TCP	
  connection
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 22
HTTP/2
22
Connections,	
  Streams,	
  Messages,	
  Frames
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
Binary	
  Frames
• Frames	
  
- HEADERS,	
  DATA,	
  PRIORITY,	
  RST_STREAM,	
  SETTINGS,	
  PUSH_PROMISE,	
  PING,	
  
GOAWAY,	
  WINDOW_UPDATE,	
  CONTINUATION	
  
- Prioritisation,	
  Flow	
  Control,	
  Server	
  Push,	
  …	
  	
  
• Single	
  TCP	
  Connection
23
POST	
  /upload	
  HTTP/1.1	
  
Host:	
  www.test.com	
  
Content-­‐Type:	
  application/json	
  
Content-­‐Length:	
  15	
  
{“name”:“duke”}
HTTP	
  1.1 HTTP/2
HEADERS	
  frame
DATA	
  frame
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 24
Multiplexing
24
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 25
Stream	
  Prioritization
• Stream	
  Dependency	
  in	
  HEADERS	
  Frame	
  
• PRIORITY	
  frame	
  type	
  
• An	
  additional	
  40	
  bytes	
  
- Stream	
  id	
  (31)	
  
- Weight	
  (8):	
  [1,	
  256]	
  	
  
- Exclusive	
  bit	
  (1)	
  
• Only	
  an	
  advice
25
A
B C
4 12
A
B CD
4 16 12
exclusive	
  =	
  0
A
B C
D
4 12
16
exclusive	
  =	
  1
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Server	
  Push
/index.html	
  	
  	
  stream	
  1	
  
/style.css	
  	
  	
  	
  	
  	
  	
  	
  stream	
  2	
  
/script.js	
  	
  	
  	
  	
  	
  	
  	
  	
  stream	
  4
Client Server
stream	
  1	
  
HEADERS
stream	
  1	
  
DATA
stream	
  2	
  	
  	
  	
  
PROMISE
stream	
  4	
  
PROMISE
26
• No	
  corresponding	
  JavaScript	
  API	
  
• Can	
  be	
  combined	
  with	
  SSE
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 27
Header	
  Compression
27
HPack
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 28
Upgrade	
  from	
  HTTP	
  1.1
• HTTP	
  
- Port	
  80	
  
- HTTP	
  Upgrade	
  to	
  “h2c”	
  (101	
  Switching	
  Protocol)	
  
• HTTPS	
  (*)	
  
- Application	
  Layer	
  Protocol	
  Negotiation	
  (ALPN)	
  
- Next	
  Protocol	
  Negotiation	
  (NPN)	
  
(*)	
  TLS	
  is	
  not	
  mandatory
28
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Java	
  EE	
  8	
  
Why	
  HTTP/2?	
  
HTTP/2	
  Big	
  Features	
  
HTTP/2	
  and	
  Java	
  EE	
  
HTTP/2	
  and	
  Java	
  SE	
  
Summary
29
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 30
• Request/Response	
  multiplexing	
  
• Binary	
  Framing	
  
• Stream	
  Prioritization	
  
• Server	
  Push	
  
• Header	
  Compression	
  
• Upgrade	
  from	
  HTTP	
  1.1	
  
– ALPN	
  or	
  (NPN)	
  
– 101	
  Switching	
  Protocols
30
HTTP/2
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 31
• Request/Response	
  Multiplexing	
  
• Binary	
  Framing	
  
• Stream	
  Prioritization	
  
• Server	
  Push	
  
• Header	
  Compression	
  
• Upgrade	
  from	
  HTTP	
  1.1	
  
– ALPN	
  or	
  (NPN)	
  
– 101	
  Switching	
  Protocols
31
Features	
  Potentially	
  Exposed	
  in	
  Servlet	
  API
HTTP/2
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 32
• New	
  HttpServletRequest	
  and	
  HttpServletResponse	
  method	
  
– int	
  getStreamId()
32
Stream	
  Prioritization
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 33
• New	
  class	
  Priority	
  
– boolean	
  exclusive	
  
– int	
  streamId	
  
– int	
  weight	
  
• New	
  method	
  to	
  HttpServletRequest	
  
– Priority	
  getPriority()	
  
• New	
  methods	
  to	
  HttpServletResponse	
  
– Priority	
  getPriority()	
  
– void	
  setPriority(Priority	
  p)
33
Stream	
  Prioritization
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 34
• Push	
  resource	
  to	
  client	
  for	
  a	
  given	
  url	
  and	
  headers	
  
• May	
  add	
  callback	
  for	
  completion	
  or	
  error	
  of	
  a	
  push	
  
• Not	
  a	
  replacement	
  for	
  WebSocket
34
Servlet	
  4.0
Server	
  Push
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 35
Server	
  Push
public	
  class	
  ExternalContextImpl	
  extends	
  ExternalContext	
  {

	
  	
  	
  	
  //…

	
  	
  	
  	
  public	
  String	
  encodeResourceURL(String	
  url)	
  {

	
  	
  	
  	
  	
  	
  	
  	
  if	
  (null	
  ==	
  url)	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  String	
  message	
  =	
  MessageUtils.getExceptionMessageString

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID,	
  "url");

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  throw	
  new	
  NullPointerException(message);

	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  	
  	
  	
  	
  Map	
  attrs	
  =	
  getResourceAttrs();

	
  	
  	
  	
  	
  	
  	
  	
  ((HttpServletRequest)	
  request).dispatchPushRequest(url,	
  attrs);

	
  	
  	
  	
  	
  	
  	
  	
  return	
  ((HttpServletResponse)	
  response).encodeURL(url);

	
  	
  	
  	
  }

	
  	
  	
  	
  //…



}
Example	
  of	
  Potential	
  Use	
  from	
  JSF
35
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Java	
  EE	
  8	
  
Why	
  HTTP/2?	
  
HTTP/2	
  Big	
  Features	
  
HTTP/2	
  and	
  Java	
  EE	
  
HTTP/2	
  and	
  Java	
  SE	
  
Summary
36
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Java	
  SE	
  9	
  Support	
  for	
  HTTP/2
• JEP	
  110	
  
- http://openjdk.java.net/jeps/110	
  
• Easy	
  to	
  use	
  API	
  
• Covers	
  only	
  the	
  most	
  common	
  use	
  cases	
  
• Supports	
  both	
  HTTP	
  1.1	
  and	
  2
37
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 38
Java	
  SE	
  9	
  Support	
  for	
  HTTP/2
• 2	
  classes	
  
– HttpRequest	
  :	
  one	
  request/response	
  interaction	
  
– HttpRequestGroup	
  :	
  configuration	
  for	
  multiple	
  requests	
  
• Blocking	
  mode:	
  one	
  thread	
  per	
  request/response	
  
– send	
  request	
  &	
  get	
  response	
  
• Non-­‐blocking	
  mode:	
  handle	
  multiple	
  request/response	
  interactions	
  in	
  
single	
  thread	
  using	
  non-­‐blocking	
  API	
  
– analogous	
  to	
  NIO	
  selectors
Small	
  footprint
38
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Java	
  SE	
  9	
  Support	
  for	
  HTTP/2
HttpRequestGroup	
  group	
  =	
  HttpRequestGroup.create();	
  
HttpRequest	
  req	
  =	
  group.createRequest()	
  
	
  	
  	
  	
  	
  	
  	
  	
  .setRequestMethod("POST")	
  
	
  	
  	
  	
  	
  	
  	
  	
  .setRequestURI(new	
  URI("http://www.foo.com/a/b")	
  
	
  	
  	
  	
  	
  	
  	
  	
  .setRequestBody("Param1=1,Param2=2")	
  
	
  	
  	
  	
  	
  	
  	
  	
  .onResponseHeader("X-­‐Foo",	
  (request,	
  name,	
  value)	
  -­‐>	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  System.out.printf("	
  received	
  an	
  X-­‐Foo	
  header");	
  
	
  	
  	
  	
  	
  	
  	
  	
  })	
  
	
  	
  	
  	
  	
  	
  	
  .sendRequest()	
  
	
  	
  	
  	
  	
  	
  	
  .waitForCompletion();
39
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Java	
  SE	
  9	
  Support	
  for	
  HTTP/2
HttpRequestGroup	
  group	
  =	
  HttpRequestGroup.create();	
  
HttpRequest	
  req	
  =	
  group.createRequest()	
  …	
  
	
  	
  	
  	
  	
  	
  	
  	
  .onResponseBody((HttpRequest	
  request,	
  InputStream	
  in)	
  -­‐>	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (request.getResponseCode()	
  ==	
  200)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Path	
  out	
  =	
  Paths.get("/tmp/out");	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  try	
  {	
  Files.copy(in,	
  out);	
  }	
  finally	
  {	
  in.close();	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  })	
  
	
  	
  	
  	
  	
  	
  	
  	
  .sendRequest()	
  
	
  	
  	
  	
  	
  	
  	
  	
  .waitForCompletion();
40
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Java	
  EE	
  8	
  
Why	
  HTTP/2?	
  
HTTP/2	
  Big	
  Features	
  
HTTP/2	
  and	
  Java	
  EE	
  
HTTP/2	
  and	
  Java	
  SE	
  
Summary
41
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
HTTP/2
• Address	
  the	
  Limitations	
  of	
  HTTP	
  1.x	
  
- Improve	
  performance	
  	
  
- Reduce	
  latency	
  
- Improve	
  ressources	
  utilization,	
  etc.	
  
• “Compatible	
  with	
  HTTP/1.1”	
  
- Retain	
  semantics	
  of	
  HTTP	
  1.x	
  
- Define	
  interaction	
  with	
  HTTP	
  1.1	
  
• “TLS	
  not	
  mandatory”
42
Hypertext	
  Transfer	
  Protocol	
  version	
  2	
  &	
  HPACK
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
“HTTP/2	
  is	
  nearly	
  done	
  standardization”
• Jan	
  2015	
  	
  	
  	
  Enabled	
  by	
  default	
  in	
  FireFox	
  (35)	
  and	
  Chrome	
  (40)	
  
• Feb	
  2015	
  	
  	
  IESG	
  approved	
  HTTP/2	
  
• May	
  2015	
  	
  HTTP/2	
  in	
  10%	
  of	
  all	
  HTTP	
  responses	
  (FireFox)	
  (*)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  HTTP/2	
  used	
  in	
  18%	
  of	
  global	
  traffic	
  (Google)	
  (*)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  HTTP/2	
  is	
  supported	
  by	
  44%	
  of	
  browsers	
  in	
  user	
  right	
  now	
  (*)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  In	
  RFC	
  Editor’s	
  publication	
  queue	
  
(*)	
  http://daniel.haxx.se/blog/2015/05/07/http2-­‐for-­‐tcpip-­‐geeks/
43
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
HTTP/2	
  and	
  Java
• Servlet	
  4.0	
  brings	
  HTTP/2	
  to	
  Java	
  EE	
  
- 100%	
  compliant	
  implementation	
  of	
  HTTP/2	
  
- Expose	
  key	
  features	
  to	
  the	
  API	
  
• Server	
  Push	
  
• Stream	
  Prioritization	
  
• HTTP	
  1.1	
  upgrade	
  
• JDK	
  9	
  brings	
  HTTP/2	
  support	
  to	
  Java	
  SE	
  
• TBC!
44
Plans
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Resources
• https://java.net/projects/servlet-­‐spec/	
  
• http://glassfish.org/adoptajsr	
  
• http://openjdk.java.net/jeps/110	
  
• http://http2.github.io	
  
• http://chimera.labs.oreilly.com/books/1230000000545/ch12.html
45
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 46
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee

More Related Content

What's hot

Oracle Cloud: Anything as a Service
Oracle Cloud: Anything as a ServiceOracle Cloud: Anything as a Service
Oracle Cloud: Anything as a ServiceBruno Borges
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015Edward Burns
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot David Delabassee
 
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5Shaun Smith
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsPavel Bucek
 
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MorePolyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MoreShaun Smith
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Edward Burns
 
HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016Ed Burns
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015Edward Burns
 
Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEReza Rahman
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?Edward Burns
 
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXTweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXBruno Borges
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckEdward Burns
 
What's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondWhat's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondOracle
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesPavel Bucek
 
Testing Java EE Applications Using Arquillian
Testing Java EE Applications Using ArquillianTesting Java EE Applications Using Arquillian
Testing Java EE Applications Using ArquillianReza Rahman
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015Pavel Bucek
 

What's hot (20)

Oracle Cloud: Anything as a Service
Oracle Cloud: Anything as a ServiceOracle Cloud: Anything as a Service
Oracle Cloud: Anything as a Service
 
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
 
JavaCro'15 - Oracle Java Cloud Service Java PaaS - Duško Vukmanović
JavaCro'15 - Oracle Java Cloud Service  Java PaaS - Duško VukmanovićJavaCro'15 - Oracle Java Cloud Service  Java PaaS - Duško Vukmanović
JavaCro'15 - Oracle Java Cloud Service Java PaaS - Duško Vukmanović
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise Applications
 
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MorePolyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
 
MySQL
MySQLMySQL
MySQL
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015
 
HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015
 
Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EE
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?
 
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXTweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
 
What's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondWhat's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and Beyond
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based Microservices
 
Testing Java EE Applications Using Arquillian
Testing Java EE Applications Using ArquillianTesting Java EE Applications Using Arquillian
Testing Java EE Applications Using Arquillian
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015
 

Viewers also liked

Viewers also liked (7)

Java cro'15 application architecture evolution, from simple script to micro...
Java cro'15   application architecture evolution, from simple script to micro...Java cro'15   application architecture evolution, from simple script to micro...
Java cro'15 application architecture evolution, from simple script to micro...
 
HUJAK prezentacija - druženje 2012-04-03
HUJAK prezentacija - druženje 2012-04-03HUJAK prezentacija - druženje 2012-04-03
HUJAK prezentacija - druženje 2012-04-03
 
JavaCro'14 - Oracle intentions in Java area - Marin Tadić
JavaCro'14 - Oracle intentions in Java area - Marin TadićJavaCro'14 - Oracle intentions in Java area - Marin Tadić
JavaCro'14 - Oracle intentions in Java area - Marin Tadić
 
JavaCro'14 - Packaging and installing of the JEE solution – Miroslav Rešetar
JavaCro'14 - Packaging and installing of the JEE solution – Miroslav RešetarJavaCro'14 - Packaging and installing of the JEE solution – Miroslav Rešetar
JavaCro'14 - Packaging and installing of the JEE solution – Miroslav Rešetar
 
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir DžaferovićJavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
 
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter PilgrimJavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
 
JavaCro'14 - Developing Google Chromecast applications on Android – Branimir ...
JavaCro'14 - Developing Google Chromecast applications on Android – Branimir ...JavaCro'14 - Developing Google Chromecast applications on Android – Branimir ...
JavaCro'14 - Developing Google Chromecast applications on Android – Branimir ...
 

Similar to JavaCro'15 - HTTP2 Comes to Java! - David Delabassee

HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouDavid Delabassee
 
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portionmnriem
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data ServicesChris Muir
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsMaria Colgan
 
CON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To YouCON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To YouEdward Burns
 
10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em StartupsMySQL Brasil
 
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)オラクルエンジニア通信
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Dave Stokes
 
How to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesHow to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesGuatemala User Group
 
Why Upgrade to Oracle Database 12c?
Why Upgrade to Oracle Database 12c?Why Upgrade to Oracle Database 12c?
Why Upgrade to Oracle Database 12c?DLT Solutions
 
Openstack Summit Vancouver 2015 - Maintaining and Operating Swift at Public C...
Openstack Summit Vancouver 2015 - Maintaining and Operating Swift at Public C...Openstack Summit Vancouver 2015 - Maintaining and Operating Swift at Public C...
Openstack Summit Vancouver 2015 - Maintaining and Operating Swift at Public C...donaghmccabe
 
REST API Doc Best Practices
REST API Doc Best PracticesREST API Doc Best Practices
REST API Doc Best PracticesMarta Rauch
 
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年7月1日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年7月1日)はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年7月1日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年7月1日)オラクルエンジニア通信
 
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0Olivier DASINI
 
How to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesHow to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesDLT Solutions
 
How to add stuff to MySQL
How to add stuff to MySQLHow to add stuff to MySQL
How to add stuff to MySQLGeorgi Kodinov
 
5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQLMySQL Brasil
 

Similar to JavaCro'15 - HTTP2 Comes to Java! - David Delabassee (20)

HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data Services
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOps
 
CON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To YouCON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To You
 
10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups
 
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015
 
How to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesHow to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of Databases
 
Marcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL WorkbenchMarcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL Workbench
 
Why Upgrade to Oracle Database 12c?
Why Upgrade to Oracle Database 12c?Why Upgrade to Oracle Database 12c?
Why Upgrade to Oracle Database 12c?
 
Openstack Summit Vancouver 2015 - Maintaining and Operating Swift at Public C...
Openstack Summit Vancouver 2015 - Maintaining and Operating Swift at Public C...Openstack Summit Vancouver 2015 - Maintaining and Operating Swift at Public C...
Openstack Summit Vancouver 2015 - Maintaining and Operating Swift at Public C...
 
REST API Doc Best Practices
REST API Doc Best PracticesREST API Doc Best Practices
REST API Doc Best Practices
 
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年7月1日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年7月1日)はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年7月1日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年7月1日)
 
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
 
How to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesHow to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of Databases
 
How to add stuff to MySQL
How to add stuff to MySQLHow to add stuff to MySQL
How to add stuff to MySQL
 
5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL
 

More from HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association

More from HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association (20)

Java cro'21 the best tools for java developers in 2021 - hujak
Java cro'21   the best tools for java developers in 2021 - hujakJava cro'21   the best tools for java developers in 2021 - hujak
Java cro'21 the best tools for java developers in 2021 - hujak
 
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
JavaCro'21 - Java is Here To Stay - HUJAK KeynoteJavaCro'21 - Java is Here To Stay - HUJAK Keynote
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
 
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan LozićJavantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
 
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
 
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
 
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
 
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander RadovanJavantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
 
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
 
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
 
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
 
Javantura v6 - When remote work really works - the secrets behind successful ...
Javantura v6 - When remote work really works - the secrets behind successful ...Javantura v6 - When remote work really works - the secrets behind successful ...
Javantura v6 - When remote work really works - the secrets behind successful ...
 
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
Javantura v6 - Kotlin-Java Interop - Matej VidakovićJavantura v6 - Kotlin-Java Interop - Matej Vidaković
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
 
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
 
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
 
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
 
Javantura v6 - How can you improve the quality of your application - Ioannis ...
Javantura v6 - How can you improve the quality of your application - Ioannis ...Javantura v6 - How can you improve the quality of your application - Ioannis ...
Javantura v6 - How can you improve the quality of your application - Ioannis ...
 
Javantura v6 - Just say it v2 - Pavao Varela Petrac
Javantura v6 - Just say it v2 - Pavao Varela PetracJavantura v6 - Just say it v2 - Pavao Varela Petrac
Javantura v6 - Just say it v2 - Pavao Varela Petrac
 
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
Javantura v6 - Automation of web apps testing - Hrvoje RuhekJavantura v6 - Automation of web apps testing - Hrvoje Ruhek
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
 
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
 
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
Javantura v6 - Building IoT Middleware with Microservices - Mario KusekJavantura v6 - Building IoT Middleware with Microservices - Mario Kusek
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

JavaCro'15 - HTTP2 Comes to Java! - David Delabassee

  • 1. HTTP/2  Comes  to  Java David  Delabassee  (@delabassee)   Oracle Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.
  • 2. Safe  Harbor  Statement The  following  is  intended  to  outline  our  general  product  direction.  It  is  intended  for   information  purposes  only,  and  may  not  be  incorporated  into  any  contract.  It  is  not  a   commitment  to  deliver  any  material,  code,  or  functionality,  and  should  not  be  relied  upon   in  making  purchasing  decisions.  The  development,  release,  and  timing  of  any  features  or   functionality  described  for  Oracle’s  products  remains  at  the  sole  discretion  of  Oracle. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 2
  • 3. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Java  EE  8   Why  HTTP/2?   HTTP/2  Big  Features   HTTP/2  and  Java  EE   HTTP/2  and  Java  SE   Summary 3
  • 4. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Java  EE  8   Why  HTTP/2?   HTTP/2  Big  Features   HTTP/2  and  Java  EE   HTTP/2  and  Java  SE   Summary 4
  • 5. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Java  EE  8  -­‐  HTML5  Support  /  Web  Tier  Enhancements • JSON  Binding   • JSON  Processing  enhancements   • Server-­‐sent  events   • Action-­‐based  MVC   • HTTP/2  support 5
  • 6. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Java  EE  8   Why  HTTP/2?   HTTP/2  Big  Features   HTTP/2  and  Java  EE   HTTP/2  and  Java  SE   Summary 6
  • 7. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 7 HTTP  1.x 1991   1996   1999   2009   2015   HTTP/0.9   HTTP/1.0   HTTP/1.1   SPDY   HTTP/2.0  
  • 8. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 8 Back  then… 8
  • 9. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 9 Today index.html style1.css style2.css .   .   .   script1.js script9.js pic1.jpg pic8.jpg .   .   .   photo1.png photo2.png .   .   .  
  • 10. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 10 • “Conversion  Rate”  Vs.  Latency   - If  a  page  takes  longer  than  4  sec  to  load,  1/4  people  abandons  that  page   - Page  load  slowdown  of  1  sec  could  cost  Amazon  $1.6  billion  in  sales  each  year   - Slowing  search  results  by  just  0.4  sec,  Google  could  lose  8  million  searches  per  day    (http://www.fastcompany.com/1825005/how-­‐one-­‐second-­‐could-­‐cost-­‐amazon-­‐16-­‐billion-­‐sales) 10 Time  is  Money!
  • 11. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 11 google.fr  (1st)   • 3  HTTP  Requests   • 21.355  bytes   - 1  HTML   - 1  image   - 1  .js 11 Top  .FR  examples lefigaro.fr  (15th)   • 140  HTTP  Requests   • 2.736.562  bytes   - 1  HTML   - 130  images   - 6  .js   - 2  .css  
  • 12. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   HTTP  1.1 Head-­‐of-­‐Line  blocking 12 Client Server index.html index.html style1.css   style2.css   script1.js   ... style1.css   style2.css   script1.js   ...
  • 13. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 13 HTTP  1.1
  • 14. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 14 File  Concatenation  and  Image  Sprites 14 • Modern  web  page  consists  of  +90  resources  fetched  from  15  distinct   hosts  (http://httparchive.org)   • TCP  Efficiency  Improves  with  Larger  Files   • Shoving  more  than  one  logical  file  into  one  physical  file
  • 15. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 15 File  Concatenation  and  Image  Sprites 15
  • 16. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 16 HTTP  1.1 Workaround  -­‐  Domain  Sharding 16
  • 17. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 17 Asset  inlining …   <img  src="data:image/gif;base64,R0lGODlhEAAOexs3eeALMAAOazToeHh0tLS/ 7LZv0jvb29tf3Ubge8WSLrhf3kdbW1mxsjkhfkjfhGHhcjGDSHJUYgJvhgtyrHgfGfHy t56HGfGH56ge8WSLf6GGHhfkjfhhfkjfhpBREzxvt6QAA4lsjkhfkjfhdxwqBnuIoYty GhBKoOjJj6GGHvvhdsbxus38GV3pBREzxvt6QAA4lsjkhfkjfhdxwqBnuIoYtyGhBKoO jJj6GGHvvhdsbxus38GV3vvhdsbxusbasbPmfyH5BAAAjAAAALAAfhGHhcjAAAAQAA4l sjkhfkjfhGHhcjGDSHJUYgJvhgtyrHgfhfkjfhpBREzxvt6QAA4lsjkhfkjfhdxwqBnu IoYtyGhBKoOjJj6GGHvvhdsbxus38GV3GfHyt56HGfGH56ge8WsjkhfkjfhGHhcjGDSH JUYgJvhgtyrHgfGfHyt56HGfGH56gebxus38G8WSLf6GGHvvhdsbxusbaSLf6GGHvvhd sbxusbaOiQA4lsjkhfkjf4lsjkhfkjf4lsjbxus38GkhfkjfhfkjfhpBREzxvt6QAA4l sjkhfkjfhdxwqBnuIoYtyGhBKoOjJj6GGHvvhdsbxus38GV3DcPjjBceXsplojj…”  />   …
  • 18. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 18 • HTTP  uses  TCP  poorly   - HTTP:  short  and  bursty  flows  Vs.  TCP:  optimized  for  long-­‐lived  flows   • Solutions   - Sprites   - Domain  sharding   - Assets  Inlining   - File  concatenations   - … 18 HTTP/1.1  circa  1999 Problems  Vs  Solutions 1991   1996   1999   2009   2015   HTTP/0.9   HTTP/1.0   HTTP/1.1   SPDY   HTTP/2.0  
  • 19. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Java  EE  8   Why  HTTP/2?   HTTP/2  Big  Features   HTTP/2  and  Java  EE   HTTP/2  and  Java  SE   Summary 19
  • 20. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 20 HTTP/2  Features • Binary  Framing  over  single  TCP  connection   • Request/Response  multiplexing   • Stream  Prioritization   • Server  Push   • Upgrade  from  HTTP  1.1   • Header  Compression
  • 21. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 21 HTTP/2 • Fully  bi-­‐directional   – Connection
 A  TCP  socket   – Message  
 A  logical  HTTP  message,  such  as  a  request  or  a  response     – Stream
 A  bi-­‐directional  “channel”  within  a  connection,  carry  one  or  more  message   – Frame
 The  smallest  unit  of  communication  in  HTTP/2 21 Lets  you  do  more  things  with  a  single  TCP  connection
  • 22. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 22 HTTP/2 22 Connections,  Streams,  Messages,  Frames
  • 23. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   Binary  Frames • Frames   - HEADERS,  DATA,  PRIORITY,  RST_STREAM,  SETTINGS,  PUSH_PROMISE,  PING,   GOAWAY,  WINDOW_UPDATE,  CONTINUATION   - Prioritisation,  Flow  Control,  Server  Push,  …     • Single  TCP  Connection 23 POST  /upload  HTTP/1.1   Host:  www.test.com   Content-­‐Type:  application/json   Content-­‐Length:  15   {“name”:“duke”} HTTP  1.1 HTTP/2 HEADERS  frame DATA  frame
  • 24. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 24 Multiplexing 24
  • 25. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 25 Stream  Prioritization • Stream  Dependency  in  HEADERS  Frame   • PRIORITY  frame  type   • An  additional  40  bytes   - Stream  id  (31)   - Weight  (8):  [1,  256]     - Exclusive  bit  (1)   • Only  an  advice 25 A B C 4 12 A B CD 4 16 12 exclusive  =  0 A B C D 4 12 16 exclusive  =  1
  • 26. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Server  Push /index.html      stream  1   /style.css                stream  2   /script.js                  stream  4 Client Server stream  1   HEADERS stream  1   DATA stream  2         PROMISE stream  4   PROMISE 26 • No  corresponding  JavaScript  API   • Can  be  combined  with  SSE
  • 27. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 27 Header  Compression 27 HPack
  • 28. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 28 Upgrade  from  HTTP  1.1 • HTTP   - Port  80   - HTTP  Upgrade  to  “h2c”  (101  Switching  Protocol)   • HTTPS  (*)   - Application  Layer  Protocol  Negotiation  (ALPN)   - Next  Protocol  Negotiation  (NPN)   (*)  TLS  is  not  mandatory 28
  • 29. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Java  EE  8   Why  HTTP/2?   HTTP/2  Big  Features   HTTP/2  and  Java  EE   HTTP/2  and  Java  SE   Summary 29
  • 30. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 30 • Request/Response  multiplexing   • Binary  Framing   • Stream  Prioritization   • Server  Push   • Header  Compression   • Upgrade  from  HTTP  1.1   – ALPN  or  (NPN)   – 101  Switching  Protocols 30 HTTP/2
  • 31. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 31 • Request/Response  Multiplexing   • Binary  Framing   • Stream  Prioritization   • Server  Push   • Header  Compression   • Upgrade  from  HTTP  1.1   – ALPN  or  (NPN)   – 101  Switching  Protocols 31 Features  Potentially  Exposed  in  Servlet  API HTTP/2
  • 32. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 32 • New  HttpServletRequest  and  HttpServletResponse  method   – int  getStreamId() 32 Stream  Prioritization
  • 33. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 33 • New  class  Priority   – boolean  exclusive   – int  streamId   – int  weight   • New  method  to  HttpServletRequest   – Priority  getPriority()   • New  methods  to  HttpServletResponse   – Priority  getPriority()   – void  setPriority(Priority  p) 33 Stream  Prioritization
  • 34. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 34 • Push  resource  to  client  for  a  given  url  and  headers   • May  add  callback  for  completion  or  error  of  a  push   • Not  a  replacement  for  WebSocket 34 Servlet  4.0 Server  Push
  • 35. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 35 Server  Push public  class  ExternalContextImpl  extends  ExternalContext  {
        //…
        public  String  encodeResourceURL(String  url)  {
                if  (null  ==  url)  {
                        String  message  =  MessageUtils.getExceptionMessageString
                                (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID,  "url");
                        throw  new  NullPointerException(message);
                }
                Map  attrs  =  getResourceAttrs();
                ((HttpServletRequest)  request).dispatchPushRequest(url,  attrs);
                return  ((HttpServletResponse)  response).encodeURL(url);
        }
        //…
 
 } Example  of  Potential  Use  from  JSF 35
  • 36. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Java  EE  8   Why  HTTP/2?   HTTP/2  Big  Features   HTTP/2  and  Java  EE   HTTP/2  and  Java  SE   Summary 36
  • 37. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Java  SE  9  Support  for  HTTP/2 • JEP  110   - http://openjdk.java.net/jeps/110   • Easy  to  use  API   • Covers  only  the  most  common  use  cases   • Supports  both  HTTP  1.1  and  2 37
  • 38. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 38 Java  SE  9  Support  for  HTTP/2 • 2  classes   – HttpRequest  :  one  request/response  interaction   – HttpRequestGroup  :  configuration  for  multiple  requests   • Blocking  mode:  one  thread  per  request/response   – send  request  &  get  response   • Non-­‐blocking  mode:  handle  multiple  request/response  interactions  in   single  thread  using  non-­‐blocking  API   – analogous  to  NIO  selectors Small  footprint 38
  • 39. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Java  SE  9  Support  for  HTTP/2 HttpRequestGroup  group  =  HttpRequestGroup.create();   HttpRequest  req  =  group.createRequest()                  .setRequestMethod("POST")                  .setRequestURI(new  URI("http://www.foo.com/a/b")                  .setRequestBody("Param1=1,Param2=2")                  .onResponseHeader("X-­‐Foo",  (request,  name,  value)  -­‐>  {                              System.out.printf("  received  an  X-­‐Foo  header");                  })                .sendRequest()                .waitForCompletion(); 39
  • 40. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Java  SE  9  Support  for  HTTP/2 HttpRequestGroup  group  =  HttpRequestGroup.create();   HttpRequest  req  =  group.createRequest()  …                  .onResponseBody((HttpRequest  request,  InputStream  in)  -­‐>  {                                  if  (request.getResponseCode()  ==  200)  {                                      Path  out  =  Paths.get("/tmp/out");                                      try  {  Files.copy(in,  out);  }  finally  {  in.close();  }                                  }                  })                  .sendRequest()                  .waitForCompletion(); 40
  • 41. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Java  EE  8   Why  HTTP/2?   HTTP/2  Big  Features   HTTP/2  and  Java  EE   HTTP/2  and  Java  SE   Summary 41
  • 42. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. HTTP/2 • Address  the  Limitations  of  HTTP  1.x   - Improve  performance     - Reduce  latency   - Improve  ressources  utilization,  etc.   • “Compatible  with  HTTP/1.1”   - Retain  semantics  of  HTTP  1.x   - Define  interaction  with  HTTP  1.1   • “TLS  not  mandatory” 42 Hypertext  Transfer  Protocol  version  2  &  HPACK
  • 43. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. “HTTP/2  is  nearly  done  standardization” • Jan  2015        Enabled  by  default  in  FireFox  (35)  and  Chrome  (40)   • Feb  2015      IESG  approved  HTTP/2   • May  2015    HTTP/2  in  10%  of  all  HTTP  responses  (FireFox)  (*)                                          HTTP/2  used  in  18%  of  global  traffic  (Google)  (*)                                          HTTP/2  is  supported  by  44%  of  browsers  in  user  right  now  (*)                                          In  RFC  Editor’s  publication  queue   (*)  http://daniel.haxx.se/blog/2015/05/07/http2-­‐for-­‐tcpip-­‐geeks/ 43
  • 44. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. HTTP/2  and  Java • Servlet  4.0  brings  HTTP/2  to  Java  EE   - 100%  compliant  implementation  of  HTTP/2   - Expose  key  features  to  the  API   • Server  Push   • Stream  Prioritization   • HTTP  1.1  upgrade   • JDK  9  brings  HTTP/2  support  to  Java  SE   • TBC! 44 Plans
  • 45. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Resources • https://java.net/projects/servlet-­‐spec/   • http://glassfish.org/adoptajsr   • http://openjdk.java.net/jeps/110   • http://http2.github.io   • http://chimera.labs.oreilly.com/books/1230000000545/ch12.html 45
  • 46. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 46