SlideShare a Scribd company logo
HTTP/2 
Comes 
to 
Java 
What 
Servlet 
4.0 
Means 
to 
You 
JAZOON 
2014 
David 
Delabassee 
(@delabassee) 
Oracle 
Copyright 
© 
2014, 
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 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
2
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Agenda 
Java 
EE 
8 
Why 
HTTP/2? 
HTTP/2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP/2 
Summary 
and 
Current 
Status 
3
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Agenda 
Java 
EE 
8 
Why 
HTTP/2? 
HTTP/2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP/2 
Summary 
and 
Current 
Status 
4
DEVELOPER 
PRODUCTIVITY 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
Java 
EE 
7 
ENTERPRISE 
EDITION 
▪Batch 
▪Concurrency 
▪Simplified JMS 
▪More annotated POJOs 
▪Less boilerplate code 
▪Cohesive integrated platform 
▪WebSockets 
▪JSON 
▪Servlet 3.1 NIO 
▪REST 
MEETING 
ENTERPRISE 
DEMANDS 
Java EE 7 
5
Industry 
Trends 
We're 
Seeing 
Reactive 
Programming 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
Cloud 
Mobile 
HTTP/2 
SECURITY 
User 
Experience 
6
Java 
EE 
8 
Community 
Survey 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
• 3 
parts 
over 
3½ 
months 
– 47 
questions 
– 15 
fill-­‐ins 
– 1000’s 
of 
comments 
• 4500+ 
respondents 
• Prioritization 
of 
most-­‐popular 
features 
7
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved.
Community-­‐Prioritized 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
9
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
Java 
EE 
8 
Themes 
• HTML5 
/ 
Web 
Tier 
Enhancements 
• Infrastructure 
for 
running 
in 
the 
Cloud 
• Ease 
of 
Development 
/ 
CDI 
alignment 
10
Ease 
of 
Development 
/ 
CDI 
Alignment 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
• Security 
interceptors 
• Simplified 
messaging 
through 
CDI-­‐based 
“MDBs” 
• JAX-­‐RS 
injection 
alignment 
• WebSocket 
scopes 
• Pruning 
of 
EJB 
2.x 
client 
view 
and 
IIOP 
interoperability 
11
Modernize 
the 
Infrastructure 
For 
On-­‐Premise 
and 
for 
in 
the 
Cloud 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
• Java 
EE 
Management 
2.0 
– REST-­‐based 
APIs 
for 
Management 
and 
Deployment 
• Java 
EE 
Security 
1.0 
– Authorization 
– Password 
Aliasing 
– User 
Management 
– Role 
Mapping 
– Authentication 
– REST 
Authentication 
12
HTML5 
Support 
/ 
Web 
Tier 
Enhancements 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
• JSON 
Binding 
• JSON 
Processing 
enhancements 
• Server-­‐sent 
events 
• Action-­‐based 
MVC 
• HTTP/2 
support 
13
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
Java 
EE 
8 
JSRs 
• Java 
EE 
8 
Platform 
• CDI 
2.0 
• JSON 
Binding 
1.0 
• JAX-­‐RS 
2.1 
• MVC 
1.0 
• Java 
Servlet 
4.0 
• JSF 
2.3 
• JMS 
2.1 
• JSON-­‐P 
1.1 
• Java 
EE 
Security 
1.0 
• Java 
EE 
Management 
2.0 
• … 
and 
more 
to 
follow 
… 
So 
far….. Coming 
soon 
….. 
14
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Agenda 
Java 
EE 
8 
Why 
HTTP/2? 
HTTP/2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP/2 
Summary 
and 
Current 
Status 
15
. 
. 
. 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
A 
Real 
Life 
Example 
index.html 
style1.css 
style2.css 
script1.js 
. 
. 
. 
script9.js 
pic1.jpg 
pic8.jpg 
photo1.png 
photo2.png 
. 
. 
.
Client Server 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Problems 
in 
HTTP 
1.1 
• HTTP 
Pipelining 
• Head-­‐of-­‐Line 
blocking 
index.html 
style1.css 
style2.css 
index.html 
style1.css 
style2.css 
script1.js 
script2.js 
. 
. 
. 
script1.js 
script2.js 
. 
. 
.
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Inefficient 
use 
of 
TCP 
sockets 
Client Server Client Server 
Client Server 
Client Server 
Client Server 
Client Server 
Problems 
in 
HTTP 
1.1
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
At 
the 
beginning… 
19 
<img/>
File 
Concatenation 
and 
Image 
Sprites 
TCP 
Efficiency 
Improves 
with 
Larger 
Files 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
20 
• Modern 
web 
page 
now 
consists 
of 
more 
than 
90 
resources 
fetched 
from 
15 
distinct 
hosts 
- http://httparchive.org 
• Solution 
– Shoving 
more 
than 
one 
logical 
file 
into 
one 
physical 
file
File 
Concatenation 
and 
Image 
Sprites 
TCP 
Efficiency 
Improves 
with 
Larger 
Files 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
21 
.ic-­‐AerospaceAndDefense-­‐wht-­‐on-­‐gray, 
.ic-­‐AerospaceAndDefense-­‐wht-­‐on-­‐red, 
.ic-­‐ 
Airline-­‐wht-­‐on-­‐gray, 
.ic-­‐Airline-­‐wht-­‐on-­‐red{ 
background: 
url(sprites.png) 
no-­‐repeat; 
} 
.ic-­‐AerospaceAndDefense-­‐wht-­‐on-­‐gray{ 
background-­‐position: 
0 
0; 
width: 
80px; 
height: 
80px; 
} 
.ic-­‐AerospaceAndDefense-­‐wht-­‐on-­‐red{ 
background-­‐position: 
-­‐81px 
0; 
width: 
80px; 
height: 
80px; 
} 
.ic-­‐Airline-­‐wht-­‐on-­‐gray{ 
background-­‐position: 
0 
-­‐80px 
; 
width: 
80px; 
height: 
80px; 
} 
.ic-­‐Airline-­‐wht-­‐on-­‐red{ 
background-­‐position: 
-­‐81px 
-­‐79px 
; 
width: 
80px; 
height: 
80px; 
}
File 
Concatenation 
and 
Image 
Sprites 
TCP 
Efficiency 
Improves 
with 
Larger 
Files 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
22
Domain 
Sharding 
Split 
page 
resources 
across 
several 
hosts 
to 
work 
around 
browser 
limits 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
23
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Inlined 
Assets 
Base64 
Encoding 
Will 
Never 
Die 
• data 
URLs 
• <img 
src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/ 
7LZv0jvb29tf3Ubge8WSLrhf3kdbW1mxsbPmfyH5BAAAjAAAALAAfhGHhcjA 
AAAQAA4lsjkhfkjfhGHhcjGDSHJUYgJvhgtyrHgfGfHyt56HGfGH56ge8WSLf6G 
GHvvhdsbxusbaOiQA4lsjkhfkjf4lsjkhfkjf4lsjkhfkjfhfkjfhpBREzxvt6QAA4lsjkhf 
kjfhdxwqBnuIoYtyGhBKoOjJj6GGHvvhdsbxus38GV3DcPjjBceXsplojj…” 
/> 
24
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• HTTP 
uses 
TCP 
poorly 
- HTTP 
flows 
are 
short 
and 
bursty 
- TCP 
was 
built 
for 
long-­‐lived 
flows 
• Solutions 
– Sprites 
– Domain 
sharding 
– Assets 
Inlining 
– File 
concatenations 
– … 
25 
HTTP 
1.1 
circa 
1999 
Problems 
Vs 
Solutions
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• “Conversion 
Rate” 
Vs 
Latency 
- 1 
in 
4 
people 
abandons 
surfing 
to 
a 
site 
if 
the 
page 
takes 
longer 
than 
4 
seconds 
to 
loads 
- Page 
load 
slowdown 
of 
1 
second 
could 
cost 
Amazon 
$1.6 
billion 
in 
sales 
each 
year 
- Slowing 
search 
results 
by 
just 
4/10 
of 
a 
second, 
Google 
could 
lose 
8 
million 
searches 
per 
day 
- http://www.fastcompany.com/1825005/how-­‐one-­‐second-­‐could-­‐cost-­‐amazon-­‐16-­‐ 
billion-­‐sales 
26 
Time 
is 
Money!
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
google.fr 
(1st) 
• 3 
HTTP 
Requests 
• 21.355 
bytes 
- 1 
HTML 
- 1 
image 
- 1 
? 
27 
Top 
.FR 
examples 
lefigaro.fr 
(15th) 
• 140 
HTTP 
Requests 
• 2.736.562 
bytes 
- 1 
HTML 
- 130 
images 
- 6 
.js 
- 2 
.css 
- 1 
?
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Agenda 
Java 
EE 
8 
Why 
HTTP/2? 
HTTP/2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP/2 
Summary 
and 
Current 
Status 
28
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
29 
HTTP/2 
Big 
Ticket 
Features 
Review 
• Binary 
Framing 
• Request/Response 
multiplexing 
• Stream 
Prioritization 
• Server 
Push 
• Header 
Compression 
• Upgrade 
from 
HTTP 
1.1 
- ALPN 
(or 
NPN) 
- 101 
Switching 
Protocols
HTTP/2 
Request 
Response 
Multiplexing 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Fully 
bi-­‐directional 
– Connection 
A 
TCP 
socket 
– Stream 
A 
“channel” 
within 
a 
connection 
– Message 
A 
logical 
message, 
such 
as 
a 
request 
or 
a 
response 
– Frame 
The 
smallest 
unit 
of 
communication 
in 
HTTP/2 
30 
Lets 
you 
do 
more 
things 
with 
a 
single 
TCP 
connection
HTTP/2 
Request 
Response 
Multiplexing 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
31 
Connections, 
Streams, 
Messages, 
Frames
HTTP/2 
Request 
Response 
Multiplexing 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Communication 
broken 
into 
frames 
• Logical 
streams 
can 
be 
interweaved 
over 
a 
single 
TCP 
connection 
32 
Connections, 
Streams, 
Messages, 
Frames
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
Binary 
Framing 
• Frame 
Header 
! 
• Types 
- HEADERS, 
DATA, 
PRIORITY, 
RST_STREAM, 
SETTINGS, 
PUSH_PROMISE, 
PING, 
GOAWAY, 
WINDOW_UPDATE, 
CONTINUATION 
33 
Enabled 
by 
dumping 
newline 
delimited 
ASCII 
Length 
(24) 
Type 
(8) Flags 
(8) 
R Stream 
Identifier 
(31) 
Frame 
Payload 
(0 
…)
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
Binary 
Framing 
GET 
/index.html 
HTTP/1.1 
Host: 
example.com 
Accept: 
text/html 
34 
Example 
1 
HEADERS 
+ 
END_STREAM 
+ 
END_HEADERS 
:method: 
GET 
:scheme: 
http 
:path: 
/index.html 
:authority: 
example.org 
accept: 
text/html
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
Binary 
Framing 
HTTP/1.1 
200 
OK 
Content-­‐Length: 
11 
Content-­‐Type: 
text/html 
Hello 
World 
35 
Example 
2 
HEADERS 
-­‐ 
END_STREAM 
+ 
END_HEADERS 
:status: 
200 
content-­‐length: 
11 
content-­‐type: 
text/html 
DATA 
+ 
END_STREAM 
Hello 
World
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
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 
36 
A 
B C 
4 12 
A 
B D C 
4 16 12 
exclusive 
= 
0 
A 
D 
16 
B C 
4 12 
exclusive 
= 
1
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
Server 
Push 
• Eliminates 
the 
need 
for 
resource 
inlining 
• Lets 
the 
server 
populate 
the 
browser’s 
cache 
in 
advance 
of 
the 
browser 
asking 
for 
the 
resource 
to 
put 
in 
the 
cache 
• No 
corresponding 
JavaScript 
API 
• Can 
be 
combined 
with 
SSE 
– Server 
pushes 
stuff 
into 
the 
browser’s 
cache 
– Server 
uses 
SSE 
to 
tell 
the 
browser 
to 
go 
fetch 
it 
37
HTTP/2 
Header 
Compression 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Most 
of 
the 
headers 
are 
the 
same 
in 
a 
given 
stream 
– Host: 
Accept: 
user-­‐agent: 
etc. 
–Why 
send 
them 
every 
time? 
• Server 
and 
the 
client 
keep 
tables 
of 
headers 
– Send 
tables 
references 
and 
updates 
38 
Known 
as 
HPACK
HTTP/2 
Header 
Compression 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
39
HTTP/2 
Upgrade 
from 
HTTP 
1.1 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Not 
secure 
– Port 
80 
– HTTP 
1.1 
101 
Protocol 
Switching 
• Secure 
– Next 
Protocol 
Negotiation 
(NPN) 
– Application 
Layer 
Protocol 
Negotiation 
(ALPN) 
40 
Secure 
or 
not-­‐secure?
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Agenda 
Java 
EE 
8 
Why 
HTTP/2? 
HTTP/2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP/2 
Summary 
and 
Current 
Status 
41
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Agenda 
Java 
EE 
8 
Why 
HTTP/2? 
HTTP/2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP/2 
Summary 
and 
Current 
Status 
42
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• API 
was 
designed 
for 
“One 
Request 
== 
One 
Response” 
• HTTP/2 
destroys 
this 
assumption 
• It 
will 
be 
challenging 
to 
do 
justice 
to 
the 
new 
reality 
of 
“One 
Request 
== 
One 
or 
More 
Responses” 
• We 
must 
not 
simply 
bolt 
the 
“One 
or 
More 
Responses” 
concept 
onto 
some 
convenient 
part 
of 
the 
existing 
API 
43 
Challenges 
in 
Exposing 
HTTP/2 
Features 
in 
Servlet 
API
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Request/Response 
multiplexing 
• Binary 
Framing 
• Stream 
Prioritization 
• Server 
Push 
• Header 
Compression 
• Upgrade 
from 
HTTP 
1.1 
– ALPN 
or 
(NPN) 
– 101 
Switching 
Protocols 
44 
Servlet 
4.0 
Big 
Ticket 
New 
Features
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Request/Response 
Multiplexing 
• Binary 
Framing 
• Stream 
Prioritization 
• Server 
Push 
• Header 
Compression 
• Upgrade 
from 
HTTP 
1.1 
– ALPN 
or 
(NPN) 
– 101 
Switching 
Protocols 
45 
HTTP/2 
Features 
Potentially 
Exposed 
in 
Servlet 
API
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Add 
method 
HttpServletRequest 
and 
HttpServletResponse 
– int 
getStreamId() 
46 
HTTP/2 
Features 
Potentially 
Exposed 
in 
Servlet 
API
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Add 
a 
new 
class 
Priority 
– boolean 
exclusive 
– int 
streamId 
– int 
weight 
• Add 
method 
to 
HttpServletRequest 
– Priority 
getPriority() 
• Add 
methods 
to 
HttpServletResponse 
– Priority 
getPriority() 
– void 
setPriority(Priority 
p) 
47 
Stream 
Prioritization
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• 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 
• Really 
useful 
for 
frameworks 
that 
build 
on 
Servlet, 
such 
as 
JSF 
48 
Server 
Push
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
49
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Server 
Push 
Example 
of 
Potential 
Use 
from 
JSF 
public 
class 
FacesServlet 
implements 
Servlet 
{ 
public 
void 
service(ServletRequest 
req, 
ServletResponse 
resp) 
throws 
IOException, 
ServletException 
{ 
//.. 
HttpServletRequest 
request 
= 
(HttpServletRequest) 
req; 
try 
{ 
ResourceHandler 
handler 
= 
context.getApplication().getResourceHandler(); 
if 
(handler.isResourceRequest(context) 
|| 
request.isPushRequest()) 
{ 
handler.handleResourceRequest(context); 
} 
else 
{ 
lifecycle.attachWindow(context); 
lifecycle.execute(context); 
lifecycle.render(context); 
} 
} 
} 
50
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Server 
Push 
Example 
of 
Potential 
Use 
from 
JSF 
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); 
} 
//… 
} 
51
Elastic Resilient 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Reactive 
Programming 
52 
Responsive 
Message 
Driven 
image 
credit: 
reactivemanifesto.org
Servlet 
4.0 
and 
Reactive 
Programming 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Asynchronous 
in 
Servlet 
3.0 
– ServletRequest#startAsync 
– AsyncContext 
• #addListener, 
#dispatch, 
#complete 
– AsyncListener 
• #onComplete, 
#onError, 
#onStartAsync, 
#onTimeout 
• Event-­‐driven 
– Server-­‐Sent 
Events 
53
Servlet 
4.0 
and 
Reactive 
Programming 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Non-­‐blocking 
IO 
in 
Servlet 
3.1 
– ServletInputStream 
• #setReadListener, 
#isReady 
– ServletOutputStream 
• #setWriteListener, 
#isReady 
– ReadListener 
• #onDataAvailable, 
#onAllDataRead, 
#onError 
– WriteListener 
• #onWritePossible, 
#onError 
54
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Agenda 
Java 
EE 
8 
Why 
HTTP/2? 
HTTP/2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP/2 
Summary 
and 
Current 
Status 
55
Java 
SE 
9 
Support 
for 
HTTP/2 
• JEP 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
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 
56
Java 
SE 
9 
Support 
for 
HTTP/2 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Small 
footprint 
• Two 
classes 
(working 
titles) 
– HttpRequestGroup 
• configuration 
for 
multiple 
requests 
– HttpRequest 
• one 
request/response 
interaction 
57
Java 
SE 
9 
Support 
for 
HTTP/2 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Small 
footprint 
• 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 
58
Java 
SE 
9 
Support 
for 
HTTP/2 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Responses 
handled 
through 
lambda 
style 
callback 
handlers 
– Invoked 
on 
the 
calling 
thread 
– Must 
allocate 
threads 
to 
responses 
manually 
• Request/Response 
bodies 
handled 
as 
InputStream/OutputStream 
Callback 
handlers 
59
Java 
SE 
9 
Support 
for 
HTTP/2 
HttpRequestGroup 
group 
= 
HttpRequestGroup.create(); 
HttpRequest 
req 
= 
group.createRequest() 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
.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(); 
60
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(); 
} 
} 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
}) 
.sendRequest() 
.waitForCompletion(); 
61
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Agenda 
Java 
EE 
8 
Why 
HTTP/2? 
HTTP/2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP/2 
Summary 
and 
Current 
Status 
62
Summary 
and 
Current 
Status 
• Dec 
2014 
Submit 
HTTP/2 
to 
IESG 
for 
consideration 
as 
a 
Proposed 
Standard 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Jan 
2015 
Submit 
HTTP/2 
to 
RFC 
Editor 
• Feb 
2015 
Publish 
HTTP/2 
as 
an 
RFC 
63
Summary 
and 
Current 
Status 
• Servlet 
4.0 
brings 
HTTP/2 
to 
Java 
EE 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
– 100% 
compliant 
implementation 
of 
HTTP/2 
– Expose 
key 
features 
to 
the 
API 
• Server 
Push 
• Stream 
Prioritization 
• HTTP 
1.1 
upgrade 
64
Summary 
and 
Current 
Status 
• Tentative 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Delivery 
Schedule 
– Q3 
2014: 
JSR 
369 
Expert 
Group 
formed 
– Q1 
2015: 
early 
draft 
– Q3 
2015: 
public 
review 
– Q4 
2015: 
proposed 
final 
draft 
– Q3 
2016: 
final 
release 
• Contribute! 
65
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
How 
to 
Get 
Involved 
• Join 
an 
Expert 
Group 
project 
– http://javaee-­‐spec.java.net 
• Adopt 
a 
JSR 
– http://glassfish.org/adoptajsr 
• The 
Aquarium 
– http://blogs.oracle.com/theaquarium 
• Java 
EE 
8 
Reference 
Implementation 
– http://glassfish.org 
66
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
Resources 
• https://java.net/projects/servlet-­‐spec/ 
• https://jcp.org/en/jsr/detail?id=369 
• http://openjdk.java.net/jeps/110 
• http://http2.github.io 
• http://chimera.labs.oreilly.com/books/1230000000545/ch12.html 
67
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
68
HTTP/2 Comes to Java - What Servlet 4.0 Means to You

More Related Content

What's hot

톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우
jieunsys
 
Developing and Deploying Apps with the Postgres FDW
Developing and Deploying Apps with the Postgres FDWDeveloping and Deploying Apps with the Postgres FDW
Developing and Deploying Apps with the Postgres FDW
Jonathan Katz
 
Database change management with Liquibase
Database change management with LiquibaseDatabase change management with Liquibase
Database change management with Liquibase
Jarosław Szczepankiewicz
 
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Rich Cullen
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
PradeepDyavannanavar
 
Introducing Oracle Audit Vault and Database Firewall
Introducing Oracle Audit Vault and Database FirewallIntroducing Oracle Audit Vault and Database Firewall
Introducing Oracle Audit Vault and Database Firewall
Troy Kitch
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And Whatudaymoogala
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
Postman
 
MariaDB migration from commercial database
MariaDB migration from commercial databaseMariaDB migration from commercial database
MariaDB migration from commercial database
GOTO Satoru
 
Higher Order Components and Render Props
Higher Order Components and Render PropsHigher Order Components and Render Props
Higher Order Components and Render Props
Nitish Phanse
 
MySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptxMySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptx
NeoClova
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
Josué Neis
 
SteelEye 표준 제안서
SteelEye 표준 제안서SteelEye 표준 제안서
SteelEye 표준 제안서Yong-uk Choe
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
Jeff Smith
 
UKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksUKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksKyle Hailey
 
Guidelines for moving from Oracle Forms to Oracle ADF and SOA
Guidelines for moving from Oracle Forms to Oracle ADF and SOAGuidelines for moving from Oracle Forms to Oracle ADF and SOA
Guidelines for moving from Oracle Forms to Oracle ADF and SOASteven Davelaar
 
Odi installation guide
Odi installation guideOdi installation guide
Odi installation guideprakashdas05
 
DVGA writeup
DVGA writeupDVGA writeup
DVGA writeup
Yu Iwama
 
SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)
Lucas Jellema
 

What's hot (20)

톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우
 
Developing and Deploying Apps with the Postgres FDW
Developing and Deploying Apps with the Postgres FDWDeveloping and Deploying Apps with the Postgres FDW
Developing and Deploying Apps with the Postgres FDW
 
Database change management with Liquibase
Database change management with LiquibaseDatabase change management with Liquibase
Database change management with Liquibase
 
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
Introducing Oracle Audit Vault and Database Firewall
Introducing Oracle Audit Vault and Database FirewallIntroducing Oracle Audit Vault and Database Firewall
Introducing Oracle Audit Vault and Database Firewall
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
 
MariaDB migration from commercial database
MariaDB migration from commercial databaseMariaDB migration from commercial database
MariaDB migration from commercial database
 
Higher Order Components and Render Props
Higher Order Components and Render PropsHigher Order Components and Render Props
Higher Order Components and Render Props
 
MySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptxMySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptx
 
Checklist_AC.pdf
Checklist_AC.pdfChecklist_AC.pdf
Checklist_AC.pdf
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
SteelEye 표준 제안서
SteelEye 표준 제안서SteelEye 표준 제안서
SteelEye 표준 제안서
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
 
UKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksUKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction Locks
 
Guidelines for moving from Oracle Forms to Oracle ADF and SOA
Guidelines for moving from Oracle Forms to Oracle ADF and SOAGuidelines for moving from Oracle Forms to Oracle ADF and SOA
Guidelines for moving from Oracle Forms to Oracle ADF and SOA
 
Odi installation guide
Odi installation guideOdi installation guide
Odi installation guide
 
DVGA writeup
DVGA writeupDVGA writeup
DVGA writeup
 
SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)
 

Similar to HTTP/2 Comes to Java - What Servlet 4.0 Means to You

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
Edward Burns
 
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
mnriem
 
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
Edward Burns
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
David Delabassee
 
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
Ed Burns
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015
Edward Burns
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise Applications
Pavel Bucek
 
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
Edward Burns
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data Services
Chris Muir
 
What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)
Pavel Bucek
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
Kris Rice
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
Edward Burns
 
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementUsing MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Mark Matthews
 
Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016
Kellyn Pot'Vin-Gorman
 
WebRTC with Java
WebRTC with JavaWebRTC with Java
WebRTC with Java
amithap07
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015
Pavel Bucek
 
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration UtilityOracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Noel Sidebotham
 
WebLogic 12c - OMF Canberra June 2014
WebLogic 12c - OMF Canberra June 2014WebLogic 12c - OMF Canberra June 2014
WebLogic 12c - OMF Canberra June 2014
Joelith
 
Some Oracle AWR observations
Some Oracle AWR observationsSome Oracle AWR observations
Some Oracle AWR observations
Connor McDonald
 

Similar to HTTP/2 Comes to Java - What Servlet 4.0 Means to You (20)

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
 
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
 
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
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
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
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise Applications
 
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
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data Services
 
What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
 
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementUsing MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance Improvement
 
Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016
 
WebRTC with Java
WebRTC with JavaWebRTC with Java
WebRTC with Java
 
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
JavaCro'15 - HTTP2 Comes to Java! - David DelabasseeJavaCro'15 - HTTP2 Comes to Java! - David Delabassee
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015
 
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration UtilityOracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
 
WebLogic 12c - OMF Canberra June 2014
WebLogic 12c - OMF Canberra June 2014WebLogic 12c - OMF Canberra June 2014
WebLogic 12c - OMF Canberra June 2014
 
Some Oracle AWR observations
Some Oracle AWR observationsSome Oracle AWR observations
Some Oracle AWR observations
 

More from David Delabassee

JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
David Delabassee
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
David Delabassee
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & Triumphs
David Delabassee
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
David Delabassee
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
David Delabassee
 
Java Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed Banff
David Delabassee
 
Serverless Kotlin
Serverless KotlinServerless Kotlin
Serverless Kotlin
David Delabassee
 
REST in an Async World
REST in an Async WorldREST in an Async World
REST in an Async World
David Delabassee
 
JAX-RS 2.1 Reloaded
JAX-RS 2.1 ReloadedJAX-RS 2.1 Reloaded
JAX-RS 2.1 Reloaded
David Delabassee
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 update
David Delabassee
 
Java EE Next
Java EE NextJava EE Next
Java EE Next
David Delabassee
 
Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016
David Delabassee
 
HTTP/2 comes to Java
HTTP/2 comes to JavaHTTP/2 comes to Java
HTTP/2 comes to Java
David Delabassee
 
Java EE 8 - Work in progress
Java EE 8 - Work in progressJava EE 8 - Work in progress
Java EE 8 - Work in progress
David Delabassee
 
HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)
David Delabassee
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
David Delabassee
 
Java EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web front
David Delabassee
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
David Delabassee
 
What's coming in Java EE 8
What's coming in Java EE 8What's coming in Java EE 8
What's coming in Java EE 8
David Delabassee
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
David Delabassee
 

More from David Delabassee (20)

JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & Triumphs
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
Java Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed Banff
 
Serverless Kotlin
Serverless KotlinServerless Kotlin
Serverless Kotlin
 
REST in an Async World
REST in an Async WorldREST in an Async World
REST in an Async World
 
JAX-RS 2.1 Reloaded
JAX-RS 2.1 ReloadedJAX-RS 2.1 Reloaded
JAX-RS 2.1 Reloaded
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 update
 
Java EE Next
Java EE NextJava EE Next
Java EE Next
 
Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016
 
HTTP/2 comes to Java
HTTP/2 comes to JavaHTTP/2 comes to Java
HTTP/2 comes to Java
 
Java EE 8 - Work in progress
Java EE 8 - Work in progressJava EE 8 - Work in progress
Java EE 8 - Work in progress
 
HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
 
Java EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web front
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
What's coming in Java EE 8
What's coming in Java EE 8What's coming in Java EE 8
What's coming in Java EE 8
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
 

Recently uploaded

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 

Recently uploaded (20)

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 

HTTP/2 Comes to Java - What Servlet 4.0 Means to You

  • 1. HTTP/2 Comes to Java What Servlet 4.0 Means to You JAZOON 2014 David Delabassee (@delabassee) Oracle Copyright © 2014, 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 © 2014, Oracle and/or its affiliates. All rights reserved. | 2
  • 3. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Agenda Java EE 8 Why HTTP/2? HTTP/2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP/2 Summary and Current Status 3
  • 4. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Agenda Java EE 8 Why HTTP/2? HTTP/2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP/2 Summary and Current Status 4
  • 5. DEVELOPER PRODUCTIVITY Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Java EE 7 ENTERPRISE EDITION ▪Batch ▪Concurrency ▪Simplified JMS ▪More annotated POJOs ▪Less boilerplate code ▪Cohesive integrated platform ▪WebSockets ▪JSON ▪Servlet 3.1 NIO ▪REST MEETING ENTERPRISE DEMANDS Java EE 7 5
  • 6. Industry Trends We're Seeing Reactive Programming Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Cloud Mobile HTTP/2 SECURITY User Experience 6
  • 7. Java EE 8 Community Survey Copyright © 2014, Oracle and/or its affiliates. All rights reserved. • 3 parts over 3½ months – 47 questions – 15 fill-­‐ins – 1000’s of comments • 4500+ respondents • Prioritization of most-­‐popular features 7
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 9. Community-­‐Prioritized Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 9
  • 10. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Java EE 8 Themes • HTML5 / Web Tier Enhancements • Infrastructure for running in the Cloud • Ease of Development / CDI alignment 10
  • 11. Ease of Development / CDI Alignment Copyright © 2014, Oracle and/or its affiliates. All rights reserved. • Security interceptors • Simplified messaging through CDI-­‐based “MDBs” • JAX-­‐RS injection alignment • WebSocket scopes • Pruning of EJB 2.x client view and IIOP interoperability 11
  • 12. Modernize the Infrastructure For On-­‐Premise and for in the Cloud Copyright © 2014, Oracle and/or its affiliates. All rights reserved. • Java EE Management 2.0 – REST-­‐based APIs for Management and Deployment • Java EE Security 1.0 – Authorization – Password Aliasing – User Management – Role Mapping – Authentication – REST Authentication 12
  • 13. HTML5 Support / Web Tier Enhancements Copyright © 2014, Oracle and/or its affiliates. All rights reserved. • JSON Binding • JSON Processing enhancements • Server-­‐sent events • Action-­‐based MVC • HTTP/2 support 13
  • 14. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Java EE 8 JSRs • Java EE 8 Platform • CDI 2.0 • JSON Binding 1.0 • JAX-­‐RS 2.1 • MVC 1.0 • Java Servlet 4.0 • JSF 2.3 • JMS 2.1 • JSON-­‐P 1.1 • Java EE Security 1.0 • Java EE Management 2.0 • … and more to follow … So far….. Coming soon ….. 14
  • 15. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Agenda Java EE 8 Why HTTP/2? HTTP/2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP/2 Summary and Current Status 15
  • 16. . . . Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | A Real Life Example index.html style1.css style2.css script1.js . . . script9.js pic1.jpg pic8.jpg photo1.png photo2.png . . .
  • 17. Client Server Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Problems in HTTP 1.1 • HTTP Pipelining • Head-­‐of-­‐Line blocking index.html style1.css style2.css index.html style1.css style2.css script1.js script2.js . . . script1.js script2.js . . .
  • 18. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Inefficient use of TCP sockets Client Server Client Server Client Server Client Server Client Server Client Server Problems in HTTP 1.1
  • 19. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | At the beginning… 19 <img/>
  • 20. File Concatenation and Image Sprites TCP Efficiency Improves with Larger Files Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 20 • Modern web page now consists of more than 90 resources fetched from 15 distinct hosts - http://httparchive.org • Solution – Shoving more than one logical file into one physical file
  • 21. File Concatenation and Image Sprites TCP Efficiency Improves with Larger Files Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 21 .ic-­‐AerospaceAndDefense-­‐wht-­‐on-­‐gray, .ic-­‐AerospaceAndDefense-­‐wht-­‐on-­‐red, .ic-­‐ Airline-­‐wht-­‐on-­‐gray, .ic-­‐Airline-­‐wht-­‐on-­‐red{ background: url(sprites.png) no-­‐repeat; } .ic-­‐AerospaceAndDefense-­‐wht-­‐on-­‐gray{ background-­‐position: 0 0; width: 80px; height: 80px; } .ic-­‐AerospaceAndDefense-­‐wht-­‐on-­‐red{ background-­‐position: -­‐81px 0; width: 80px; height: 80px; } .ic-­‐Airline-­‐wht-­‐on-­‐gray{ background-­‐position: 0 -­‐80px ; width: 80px; height: 80px; } .ic-­‐Airline-­‐wht-­‐on-­‐red{ background-­‐position: -­‐81px -­‐79px ; width: 80px; height: 80px; }
  • 22. File Concatenation and Image Sprites TCP Efficiency Improves with Larger Files Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 22
  • 23. Domain Sharding Split page resources across several hosts to work around browser limits Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 23
  • 24. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Inlined Assets Base64 Encoding Will Never Die • data URLs • <img src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/ 7LZv0jvb29tf3Ubge8WSLrhf3kdbW1mxsbPmfyH5BAAAjAAAALAAfhGHhcjA AAAQAA4lsjkhfkjfhGHhcjGDSHJUYgJvhgtyrHgfGfHyt56HGfGH56ge8WSLf6G GHvvhdsbxusbaOiQA4lsjkhfkjf4lsjkhfkjf4lsjkhfkjfhfkjfhpBREzxvt6QAA4lsjkhf kjfhdxwqBnuIoYtyGhBKoOjJj6GGHvvhdsbxus38GV3DcPjjBceXsplojj…” /> 24
  • 25. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • HTTP uses TCP poorly - HTTP flows are short and bursty - TCP was built for long-­‐lived flows • Solutions – Sprites – Domain sharding – Assets Inlining – File concatenations – … 25 HTTP 1.1 circa 1999 Problems Vs Solutions
  • 26. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • “Conversion Rate” Vs Latency - 1 in 4 people abandons surfing to a site if the page takes longer than 4 seconds to loads - Page load slowdown of 1 second could cost Amazon $1.6 billion in sales each year - Slowing search results by just 4/10 of a second, Google could lose 8 million searches per day - http://www.fastcompany.com/1825005/how-­‐one-­‐second-­‐could-­‐cost-­‐amazon-­‐16-­‐ billion-­‐sales 26 Time is Money!
  • 27. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | google.fr (1st) • 3 HTTP Requests • 21.355 bytes - 1 HTML - 1 image - 1 ? 27 Top .FR examples lefigaro.fr (15th) • 140 HTTP Requests • 2.736.562 bytes - 1 HTML - 130 images - 6 .js - 2 .css - 1 ?
  • 28. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Agenda Java EE 8 Why HTTP/2? HTTP/2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP/2 Summary and Current Status 28
  • 29. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 29 HTTP/2 Big Ticket Features Review • Binary Framing • Request/Response multiplexing • Stream Prioritization • Server Push • Header Compression • Upgrade from HTTP 1.1 - ALPN (or NPN) - 101 Switching Protocols
  • 30. HTTP/2 Request Response Multiplexing Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Fully bi-­‐directional – Connection A TCP socket – Stream A “channel” within a connection – Message A logical message, such as a request or a response – Frame The smallest unit of communication in HTTP/2 30 Lets you do more things with a single TCP connection
  • 31. HTTP/2 Request Response Multiplexing Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 31 Connections, Streams, Messages, Frames
  • 32. HTTP/2 Request Response Multiplexing Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Communication broken into frames • Logical streams can be interweaved over a single TCP connection 32 Connections, Streams, Messages, Frames
  • 33. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Binary Framing • Frame Header ! • Types - HEADERS, DATA, PRIORITY, RST_STREAM, SETTINGS, PUSH_PROMISE, PING, GOAWAY, WINDOW_UPDATE, CONTINUATION 33 Enabled by dumping newline delimited ASCII Length (24) Type (8) Flags (8) R Stream Identifier (31) Frame Payload (0 …)
  • 34. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Binary Framing GET /index.html HTTP/1.1 Host: example.com Accept: text/html 34 Example 1 HEADERS + END_STREAM + END_HEADERS :method: GET :scheme: http :path: /index.html :authority: example.org accept: text/html
  • 35. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Binary Framing HTTP/1.1 200 OK Content-­‐Length: 11 Content-­‐Type: text/html Hello World 35 Example 2 HEADERS -­‐ END_STREAM + END_HEADERS :status: 200 content-­‐length: 11 content-­‐type: text/html DATA + END_STREAM Hello World
  • 36. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 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 36 A B C 4 12 A B D C 4 16 12 exclusive = 0 A D 16 B C 4 12 exclusive = 1
  • 37. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Server Push • Eliminates the need for resource inlining • Lets the server populate the browser’s cache in advance of the browser asking for the resource to put in the cache • No corresponding JavaScript API • Can be combined with SSE – Server pushes stuff into the browser’s cache – Server uses SSE to tell the browser to go fetch it 37
  • 38. HTTP/2 Header Compression Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Most of the headers are the same in a given stream – Host: Accept: user-­‐agent: etc. –Why send them every time? • Server and the client keep tables of headers – Send tables references and updates 38 Known as HPACK
  • 39. HTTP/2 Header Compression Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 39
  • 40. HTTP/2 Upgrade from HTTP 1.1 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Not secure – Port 80 – HTTP 1.1 101 Protocol Switching • Secure – Next Protocol Negotiation (NPN) – Application Layer Protocol Negotiation (ALPN) 40 Secure or not-­‐secure?
  • 41. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Agenda Java EE 8 Why HTTP/2? HTTP/2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP/2 Summary and Current Status 41
  • 42. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Agenda Java EE 8 Why HTTP/2? HTTP/2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP/2 Summary and Current Status 42
  • 43. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • API was designed for “One Request == One Response” • HTTP/2 destroys this assumption • It will be challenging to do justice to the new reality of “One Request == One or More Responses” • We must not simply bolt the “One or More Responses” concept onto some convenient part of the existing API 43 Challenges in Exposing HTTP/2 Features in Servlet API
  • 44. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Request/Response multiplexing • Binary Framing • Stream Prioritization • Server Push • Header Compression • Upgrade from HTTP 1.1 – ALPN or (NPN) – 101 Switching Protocols 44 Servlet 4.0 Big Ticket New Features
  • 45. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Request/Response Multiplexing • Binary Framing • Stream Prioritization • Server Push • Header Compression • Upgrade from HTTP 1.1 – ALPN or (NPN) – 101 Switching Protocols 45 HTTP/2 Features Potentially Exposed in Servlet API
  • 46. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Add method HttpServletRequest and HttpServletResponse – int getStreamId() 46 HTTP/2 Features Potentially Exposed in Servlet API
  • 47. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Add a new class Priority – boolean exclusive – int streamId – int weight • Add method to HttpServletRequest – Priority getPriority() • Add methods to HttpServletResponse – Priority getPriority() – void setPriority(Priority p) 47 Stream Prioritization
  • 48. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • 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 • Really useful for frameworks that build on Servlet, such as JSF 48 Server Push
  • 49. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 49
  • 50. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Server Push Example of Potential Use from JSF public class FacesServlet implements Servlet { public void service(ServletRequest req, ServletResponse resp) throws IOException, ServletException { //.. HttpServletRequest request = (HttpServletRequest) req; try { ResourceHandler handler = context.getApplication().getResourceHandler(); if (handler.isResourceRequest(context) || request.isPushRequest()) { handler.handleResourceRequest(context); } else { lifecycle.attachWindow(context); lifecycle.execute(context); lifecycle.render(context); } } } 50
  • 51. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Server Push Example of Potential Use from JSF 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); } //… } 51
  • 52. Elastic Resilient Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Reactive Programming 52 Responsive Message Driven image credit: reactivemanifesto.org
  • 53. Servlet 4.0 and Reactive Programming Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Asynchronous in Servlet 3.0 – ServletRequest#startAsync – AsyncContext • #addListener, #dispatch, #complete – AsyncListener • #onComplete, #onError, #onStartAsync, #onTimeout • Event-­‐driven – Server-­‐Sent Events 53
  • 54. Servlet 4.0 and Reactive Programming Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Non-­‐blocking IO in Servlet 3.1 – ServletInputStream • #setReadListener, #isReady – ServletOutputStream • #setWriteListener, #isReady – ReadListener • #onDataAvailable, #onAllDataRead, #onError – WriteListener • #onWritePossible, #onError 54
  • 55. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Agenda Java EE 8 Why HTTP/2? HTTP/2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP/2 Summary and Current Status 55
  • 56. Java SE 9 Support for HTTP/2 • JEP Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 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 56
  • 57. Java SE 9 Support for HTTP/2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Small footprint • Two classes (working titles) – HttpRequestGroup • configuration for multiple requests – HttpRequest • one request/response interaction 57
  • 58. Java SE 9 Support for HTTP/2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Small footprint • 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 58
  • 59. Java SE 9 Support for HTTP/2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Responses handled through lambda style callback handlers – Invoked on the calling thread – Must allocate threads to responses manually • Request/Response bodies handled as InputStream/OutputStream Callback handlers 59
  • 60. Java SE 9 Support for HTTP/2 HttpRequestGroup group = HttpRequestGroup.create(); HttpRequest req = group.createRequest() Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | .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(); 60
  • 61. 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(); } } Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | }) .sendRequest() .waitForCompletion(); 61
  • 62. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Agenda Java EE 8 Why HTTP/2? HTTP/2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP/2 Summary and Current Status 62
  • 63. Summary and Current Status • Dec 2014 Submit HTTP/2 to IESG for consideration as a Proposed Standard Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Jan 2015 Submit HTTP/2 to RFC Editor • Feb 2015 Publish HTTP/2 as an RFC 63
  • 64. Summary and Current Status • Servlet 4.0 brings HTTP/2 to Java EE Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | – 100% compliant implementation of HTTP/2 – Expose key features to the API • Server Push • Stream Prioritization • HTTP 1.1 upgrade 64
  • 65. Summary and Current Status • Tentative Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Delivery Schedule – Q3 2014: JSR 369 Expert Group formed – Q1 2015: early draft – Q3 2015: public review – Q4 2015: proposed final draft – Q3 2016: final release • Contribute! 65
  • 66. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. How to Get Involved • Join an Expert Group project – http://javaee-­‐spec.java.net • Adopt a JSR – http://glassfish.org/adoptajsr • The Aquarium – http://blogs.oracle.com/theaquarium • Java EE 8 Reference Implementation – http://glassfish.org 66
  • 67. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Resources • https://java.net/projects/servlet-­‐spec/ • https://jcp.org/en/jsr/detail?id=369 • http://openjdk.java.net/jeps/110 • http://http2.github.io • http://chimera.labs.oreilly.com/books/1230000000545/ch12.html 67
  • 68. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 68