SlideShare a Scribd company logo
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java HTTP/2 Update
Edward Burns
Java EE Specifications Team
February 2016
Java Champions Call
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. |
• Ed Burns Credentials
– Working on Web technologies since 1994
– JCP Star Spec-lead 2009
– Spec lead for JSF and Servlet
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
My Plan for Your Time Investment
HTTP/2 protocol and justification
HTTP/Related Developments in Java
Q&A
1
2
3
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
My Plan for Your Time Investment
HTTP/2 protocol and justification
HTTP/Related Developments in Java
Q&A
1
2
3
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Why HTTP/2?
A Real Life Example
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. |
Why HTTP/2?
• Head of Line Blocking
• Inefficient Use of Sockets
• Wasteful Use of Network Resources
• Not resilient to pervasive monitoring by default
Problems with HTTP/1.1
7
S
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Why HTTP/2?
• Much of what we do in web-apps is a hack to work around shortcomings in
HTTP/1.1
– File concatenation and image sprites
– Domain sharding
– Inlined assets
What is an optimization?
8
S
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Why HTTP/2?
• Head of Line Blocking
– Frame Based Binary Protocol
• Inefficient Use of Sockets
– Stream Multiplexing
• Wasteful Use of Network Resources
– Header “compression”
– Server push
• Not resilient to pervasive monitoring by default
– Per RFC-7258, TLS is the default, clear text is optional
Problems with HTTP/1.1
9
S
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
HTTP/2 is really just a new transport
layer underneath HTTP/1.1
– same request/response model
– no new methods
– no new headers
– no new usage patterns from
application layer
– no new usage of URL spec and other
lower level specs
Network Programming Review
10
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Standing on the Shoulders
11
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Network Programming Review
12
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Network Programming Review
13
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Network Programming Review
14
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Network Programming Review
15
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Network Programming Review
16
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Network Programming Review
17
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Network Programming Review
18
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
• Request/Response multiplexing
• Binary Framing
• Stream Prioritization
• Server Push
• Header Compression
• Upgrade from HTTP/1.1
– Application Layer Protocol Negotiation (ALPN)
– 101 Switching Protocols
19
HTTP/2 Big Ticket New Features
S
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
1
My Plan for Your Time Investment
HTTP/2 protocol and justification
HTTP/Related Developments in Java
Q&A
2
3
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
HTTP/2 Related Developments in Java
• Java SE JDK 9
– JEP 110: HTTP/2 Client
– JEP 244: TLS ALPN
• Java EE 8
– Servlet 4.0
• Open Source
– Jetty
– Netty
– Grizzly
– Undertow
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
HTTP/2 Related Developments in Java
• Not yet in Early Access Release – Build 104
• Fully functional in internal builds
• 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
• Builds on Java API classes going back to Java 1.2!
Java SE JDK 9
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java SE 9 Support for HTTP/2
23
HttpClientHttpClient.Builder
HttpRequest.Builder
HttpRequestHttpRequest
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java SE 9 Support for HTTP/2
• Blocking mode: one thread per request/response
– send request
– get response
• Non-blocking mode
– Using ExecutorService and CompletableFuture
• Full support for HTTP/2 Server Push
Small footprint
24
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java SE 9 Support for HTTP/2
HttpResponse response = HttpRequest
.create(new URI("http://www.foo.com"))
.headers("Foo", "foovalue", "Bar", "barvalue”)
.GET()
.response();
int statusCode = response.statusCode();
String responseBody = response.body(asString());
25
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java SE 9 Support for HTTP/2: Async Case
List<URI> targets = ... // fetch list of URIs async and store in Files
List<CompletableFuture<File>> futures = targets.stream()
.map(target -> {
return HttpRequest
.create(target).GET().responseAsync().thenCompose(response -> {
Path dest = Paths.get("base", target.getPath());
if (response.statusCode() == 200) {
return response.bodyAsync(asFile(dest));
} else {
return CompletableFuture.completedFuture(dest);
}
})
// convert Path -> File
.thenApply((Path dest) -> {
return dest.toFile();
});
}).collect(Collectors.toList());
// all async operations waited for here
CompletableFuture.allOf(futures.toArray(new CompletableFuture<?>[0])).join();
26
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java SE 9 Support for HTTP/2
• Negotiation of HTTP/2 from 1.1
– ALPN or plaintext
• Server Push
– Support for PUSH_PROMISE frames
• HPACK parameters
HTTP/2 features
27
E
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
HTTP/2 Related Developments in Java
• Request/Response multiplexing
• Binary Framing
• Stream Prioritization
• Server Push
• Header Compression
• Upgrade from HTTP/1.1
– ALPN
– 101 Switching Protocols
Java EE 8 Servlet 4.0
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Servlet 4.0 Big Ticket New Features
• HTTP/2 Required, including ALPN and HPACK
• HTTP/2 Server Push
– Push resource to client for a given url and headers
– Not at all a replacement for WebSocket
– Really useful for frameworks that build on Servlet, such as JSF
– Builder API
• Ease of Use
29
S
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
javax.servlet.http.PushBuilder
S
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | 31
Server Push via Builder API
Servlet 4.0
Big Ticket
New Features
S
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The preceding 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. |
Questions?

More Related Content

PPTX
Oracle WebLogic Server 12.2.1 Do More with Less
PPTX
Servlet 4.0 at GeekOut 2015
PDF
MVC 1.0 / JSR 371
PPTX
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
PPTX
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
PDF
JavaOne 2014 BOF4241 What's Next for JSF?
PDF
WebSockets in Enterprise Applications
PDF
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Oracle WebLogic Server 12.2.1 Do More with Less
Servlet 4.0 at GeekOut 2015
MVC 1.0 / JSR 371
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
JavaOne 2014 BOF4241 What's Next for JSF?
WebSockets in Enterprise Applications
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX

What's hot (20)

PDF
Oracle Cloud: Anything as a Service
PDF
Adopt-a-JSR for JSON Processing 1.1, JSR 374
PDF
WebSocket in Enterprise Applications 2015
PDF
Web protocols for java developers
PDF
WebSockets - Realtime em Mundo Conectado
PDF
How to Thrive on REST/WebSocket-Based Microservices
PPTX
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
PDF
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
PPTX
Migrating From Applets to Java Desktop Apps in JavaFX
PDF
CON5898 What Servlet 4.0 Means To You
PPTX
Java EE Arquillian Testing with Docker & The Cloud
PPTX
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
PDF
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
PDF
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
PDF
EJB and CDI - Alignment and Strategy
PDF
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
PPTX
Melhore o Desenvolvimento do Time com DevOps na Nuvem
PDF
Lightweight Java in the Cloud
PPTX
2015 UJUG, Servlet 4.0 portion
Oracle Cloud: Anything as a Service
Adopt-a-JSR for JSON Processing 1.1, JSR 374
WebSocket in Enterprise Applications 2015
Web protocols for java developers
WebSockets - Realtime em Mundo Conectado
How to Thrive on REST/WebSocket-Based Microservices
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
Migrating From Applets to Java Desktop Apps in JavaFX
CON5898 What Servlet 4.0 Means To You
Java EE Arquillian Testing with Docker & The Cloud
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
EJB and CDI - Alignment and Strategy
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Lightweight Java in the Cloud
2015 UJUG, Servlet 4.0 portion
Ad

Viewers also liked (14)

PPTX
Continuous Integration (CI) is about more than releases
PPTX
What DevOps means for QA Teams
PDF
Bappeda
PDF
Proud to be a black man
PPT
1C - Possessive Adjectives
PPSX
Ramsey,aquilachapter8
PDF
Gruppo Wice Formazione Office
PDF
Cтадник е.а. лимфоаденопатии
PPT
4B - Adjectives
PDF
Computación evolutiva
PDF
Лекция 2. Оптические методы визуализации
PDF
Easy Continuous Deployment You Can Trust (Webinar)
PPTX
Becoming a Data Driven Oil and Gas Enterprise with Advanced Analytics and Hadoop
PPTX
Things ilove 3A
Continuous Integration (CI) is about more than releases
What DevOps means for QA Teams
Bappeda
Proud to be a black man
1C - Possessive Adjectives
Ramsey,aquilachapter8
Gruppo Wice Formazione Office
Cтадник е.а. лимфоаденопатии
4B - Adjectives
Computación evolutiva
Лекция 2. Оптические методы визуализации
Easy Continuous Deployment You Can Trust (Webinar)
Becoming a Data Driven Oil and Gas Enterprise with Advanced Analytics and Hadoop
Things ilove 3A
Ad

Similar to HTTP/2 in the Java Platform -- Java Champions call February 2016 (20)

PDF
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
PDF
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
PPTX
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
PPTX
Java EE 8: What Servlet 4 and HTTP2 Mean
PDF
HTTP/2: What's new?
PDF
HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017
PPTX
Java EE 8: What Servlet 4.0 and HTTP2 mean to you
PPTX
PDF
HTTP/2 (2017)
PDF
HTTP/2 Comes to Java
PPTX
JDKIO: Java EE 8 what Servlet 4 and HTTP2 mean to you
PPTX
HTTP/2 in Examples
PPTX
HTTP/2 for Developers
PPTX
Next generation web protocols
KEY
What's up with HTTP?
PDF
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
PPTX
PPTX
Introduction to HTTP/2
PDF
Http 2: Should I care?
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4 and HTTP2 Mean
HTTP/2: What's new?
HTTP2 in action - Piet Van Dongen - Codemotion Amsterdam 2017
Java EE 8: What Servlet 4.0 and HTTP2 mean to you
HTTP/2 (2017)
HTTP/2 Comes to Java
JDKIO: Java EE 8 what Servlet 4 and HTTP2 mean to you
HTTP/2 in Examples
HTTP/2 for Developers
Next generation web protocols
What's up with HTTP?
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
Introduction to HTTP/2
Http 2: Should I care?

More from Ed Burns (11)

PDF
What We Learned from Porting PiggyMetrics from Spring Boot to MicroProfile
PPTX
2020-02-10 Java on Azure Solution Briefing
PPTX
What Visual Studio Code can do for Java Development
PDF
Enterprise Java on Microsoft Azure: From Java EE to Spring, we’ve got you cov...
PDF
Enterprise Java on Azure: From Java EE to Spring, we have you covered
PPTX
Programming Language Platform Growth: Table Stakes or Deal Makes?
PPTX
Oracle Code Online: Building a Serverless State Service for the Cloud
PPTX
Seminole County Teach In 2017: Crooms Acadamy of Information Technology
PPTX
JavaOne-2017 Ignite Session: How to build a Theremin
PPTX
Servlet 4.0 JavaOne 2017
PDF
Chicago JUG / GOTO Meetup
What We Learned from Porting PiggyMetrics from Spring Boot to MicroProfile
2020-02-10 Java on Azure Solution Briefing
What Visual Studio Code can do for Java Development
Enterprise Java on Microsoft Azure: From Java EE to Spring, we’ve got you cov...
Enterprise Java on Azure: From Java EE to Spring, we have you covered
Programming Language Platform Growth: Table Stakes or Deal Makes?
Oracle Code Online: Building a Serverless State Service for the Cloud
Seminole County Teach In 2017: Crooms Acadamy of Information Technology
JavaOne-2017 Ignite Session: How to build a Theremin
Servlet 4.0 JavaOne 2017
Chicago JUG / GOTO Meetup

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Transform Your Business with a Software ERP System
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
ai tools demonstartion for schools and inter college
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administraation Chapter 3
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Operating system designcfffgfgggggggvggggggggg
wealthsignaloriginal-com-DS-text-... (1).pdf
L1 - Introduction to python Backend.pptx
How Creative Agencies Leverage Project Management Software.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
CHAPTER 2 - PM Management and IT Context
Wondershare Filmora 15 Crack With Activation Key [2025
Which alternative to Crystal Reports is best for small or large businesses.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Transform Your Business with a Software ERP System
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Essential Infomation Tech presentation.pptx
Reimagine Home Health with the Power of Agentic AI​
ai tools demonstartion for schools and inter college
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administraation Chapter 3
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Odoo POS Development Services by CandidRoot Solutions

HTTP/2 in the Java Platform -- Java Champions call February 2016

  • 1. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java HTTP/2 Update Edward Burns Java EE Specifications Team February 2016 Java Champions Call
  • 2. 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.
  • 3. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | • Ed Burns Credentials – Working on Web technologies since 1994 – JCP Star Spec-lead 2009 – Spec lead for JSF and Servlet
  • 4. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | My Plan for Your Time Investment HTTP/2 protocol and justification HTTP/Related Developments in Java Q&A 1 2 3
  • 5. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | My Plan for Your Time Investment HTTP/2 protocol and justification HTTP/Related Developments in Java Q&A 1 2 3
  • 6. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Why HTTP/2? A Real Life Example index.html style1.css style2.css . . . script1.js script9.js pic1.jpg pic8.jpg . . . photo1.png photo2.png . . .
  • 7. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Why HTTP/2? • Head of Line Blocking • Inefficient Use of Sockets • Wasteful Use of Network Resources • Not resilient to pervasive monitoring by default Problems with HTTP/1.1 7 S
  • 8. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Why HTTP/2? • Much of what we do in web-apps is a hack to work around shortcomings in HTTP/1.1 – File concatenation and image sprites – Domain sharding – Inlined assets What is an optimization? 8 S
  • 9. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Why HTTP/2? • Head of Line Blocking – Frame Based Binary Protocol • Inefficient Use of Sockets – Stream Multiplexing • Wasteful Use of Network Resources – Header “compression” – Server push • Not resilient to pervasive monitoring by default – Per RFC-7258, TLS is the default, clear text is optional Problems with HTTP/1.1 9 S
  • 10. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | HTTP/2 is really just a new transport layer underneath HTTP/1.1 – same request/response model – no new methods – no new headers – no new usage patterns from application layer – no new usage of URL spec and other lower level specs Network Programming Review 10 E
  • 11. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Standing on the Shoulders 11 E
  • 12. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Network Programming Review 12 E
  • 13. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Network Programming Review 13 E
  • 14. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Network Programming Review 14 E
  • 15. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Network Programming Review 15 E
  • 16. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Network Programming Review 16 E
  • 17. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Network Programming Review 17 E
  • 18. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Network Programming Review 18 E
  • 19. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | • Request/Response multiplexing • Binary Framing • Stream Prioritization • Server Push • Header Compression • Upgrade from HTTP/1.1 – Application Layer Protocol Negotiation (ALPN) – 101 Switching Protocols 19 HTTP/2 Big Ticket New Features S
  • 20. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | 1 My Plan for Your Time Investment HTTP/2 protocol and justification HTTP/Related Developments in Java Q&A 2 3
  • 21. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Related Developments in Java • Java SE JDK 9 – JEP 110: HTTP/2 Client – JEP 244: TLS ALPN • Java EE 8 – Servlet 4.0 • Open Source – Jetty – Netty – Grizzly – Undertow
  • 22. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Related Developments in Java • Not yet in Early Access Release – Build 104 • Fully functional in internal builds • 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 • Builds on Java API classes going back to Java 1.2! Java SE JDK 9
  • 23. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java SE 9 Support for HTTP/2 23 HttpClientHttpClient.Builder HttpRequest.Builder HttpRequestHttpRequest E
  • 24. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java SE 9 Support for HTTP/2 • Blocking mode: one thread per request/response – send request – get response • Non-blocking mode – Using ExecutorService and CompletableFuture • Full support for HTTP/2 Server Push Small footprint 24 E
  • 25. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java SE 9 Support for HTTP/2 HttpResponse response = HttpRequest .create(new URI("http://www.foo.com")) .headers("Foo", "foovalue", "Bar", "barvalue”) .GET() .response(); int statusCode = response.statusCode(); String responseBody = response.body(asString()); 25 E
  • 26. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java SE 9 Support for HTTP/2: Async Case List<URI> targets = ... // fetch list of URIs async and store in Files List<CompletableFuture<File>> futures = targets.stream() .map(target -> { return HttpRequest .create(target).GET().responseAsync().thenCompose(response -> { Path dest = Paths.get("base", target.getPath()); if (response.statusCode() == 200) { return response.bodyAsync(asFile(dest)); } else { return CompletableFuture.completedFuture(dest); } }) // convert Path -> File .thenApply((Path dest) -> { return dest.toFile(); }); }).collect(Collectors.toList()); // all async operations waited for here CompletableFuture.allOf(futures.toArray(new CompletableFuture<?>[0])).join(); 26 E
  • 27. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java SE 9 Support for HTTP/2 • Negotiation of HTTP/2 from 1.1 – ALPN or plaintext • Server Push – Support for PUSH_PROMISE frames • HPACK parameters HTTP/2 features 27 E
  • 28. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Related Developments in Java • Request/Response multiplexing • Binary Framing • Stream Prioritization • Server Push • Header Compression • Upgrade from HTTP/1.1 – ALPN – 101 Switching Protocols Java EE 8 Servlet 4.0
  • 29. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Servlet 4.0 Big Ticket New Features • HTTP/2 Required, including ALPN and HPACK • HTTP/2 Server Push – Push resource to client for a given url and headers – Not at all a replacement for WebSocket – Really useful for frameworks that build on Servlet, such as JSF – Builder API • Ease of Use 29 S
  • 30. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | javax.servlet.http.PushBuilder S
  • 31. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | 31 Server Push via Builder API Servlet 4.0 Big Ticket New Features S
  • 32. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The preceding 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.
  • 33. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Questions?

Editor's Notes

  • #2: This is a Title Slide with Picture slide ideal for including a picture with a brief title, subtitle and presenter information. To customize this slide with your own picture: Right-click the slide area and choose Format Background from the pop-up menu. From the Fill menu, click Picture and texture fill. Under Insert from: click File. Locate your new picture and click Insert. To copy the Customized Background from Another Presentation on PC Click New Slide from the Home tab's Slides group and select Reuse Slides. Click Browse in the Reuse Slides panel and select Browse Files. Double-click the PowerPoint presentation that contains the background you wish to copy. Check Keep Source Formatting and click the slide that contains the background you want. Click the left-hand slide preview to which you wish to apply the new master layout. Apply New Layout (Important): Right-click any selected slide, point to Layout, and click the slide containing the desired layout from the layout gallery. Delete any unwanted slides or duplicates. To copy the Customized Background from Another Presentation on Mac Click New Slide from the Home tab's Slides group and select Insert Slides from Other Presentation… Navigate to the PowerPoint presentation file that contains the background you wish to copy. Double-click or press Insert. This prompts the Slide Finder dialogue box. Make sure Keep design of original slides is unchecked and click the slide(s) that contains the background you want. Hold Shift key to select multiple slides. Click the left-hand slide preview to which you wish to apply the new master layout. Apply New Layout (Important): Click Layout from the Home tab's Slides group, and click the slide containing the desired layout from the layout gallery. Delete any unwanted slides or duplicates.
  • #3: Frank Nimphius: Glaubt alles, kauft nichts. ----- Meeting Notes (11/19/15 13:44) ----- Normally the German takes longer than the English, but not in this case.
  • #4: This is a Remote Speaker Picture slide ideal for including a picture with the speaker’s name and title and company. To Replace the Picture on this sample slide (this applies to all slides in this template that contain replaceable pictures) Select the sample picture and press Delete. Click the icon inside the shape to open the Insert Picture dialog box. Navigate to the location where the picture is stored, select desired picture and click on the Insert button to fit the image proportionally within the shape. Note: Do not right-click the image to change the picture inside the picture placeholder. This will change the frame size of the picture placeholder. Instead, follow the steps outlined above.
  • #7: 30 resources 2 styelsheets 9 java scripts 8 jpg images 2 pngs ----- Meeting Notes (3/11/15 14:24) ----- Google research used to inform design of h2 from the beginning. From RFC 7540: HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection. It also introduces unsolicited push of representations from servers to clients.
  • #8: TCP efficiency with large files inlined images can't be easily cached and shared across pages. Base64 encoding / decoding
  • #9: TCP efficiency with large files inlined images can't be easily cached and shared across pages. Base64 encoding / decoding
  • #10: TCP efficiency with large files inlined images can't be easily cached and shared across pages. Base64 encoding / decoding
  • #11: This is important because HTTP/2 is essentially a new transport layer underneath the existing HTTP/1.1 semantics + a header compression specification. Same request/response model No new HTTP methods (except for PRI but that's just for the protocol) No new headers (but new names/concepts for old headers) No new usage pattern from application level Same usage of URL spec and TCP ports
  • #12: Care has been taken to avoid the "not invented here" syndrome, and to re-use concepts already proven successful.
  • #14: Physical: electrical and physical specifications of the data connection. Token ring, ethernet, etc. Data Link: MAC addresses, node-to-node transfer, anyone remember PPP? Reliable communication. Network: This is where routing comes in. This is how datagrams can make it between nodes that are not directly connected to each other. Multicast group management lives here. Transport: This is where TCP and UDP live. Session: home of the concept of a connection being created and closed. The connection lifecycle lives here. The UNIX Socket API lives here. Presentation: This is where Transport Layer Security lives (incorrectly named, eh?). Mime is another example of a presentation layer protocol. Does anyone here do anything with layers 6 and below here?
  • #30: May add callback for completion or error of a push ? In the future?
  • #32: Reuse PushBuilder order
  • #33: This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template. One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy To learn more about this policy, e-mail: Revrec-americasiebc_us@oracle.com For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.   http://my.oracle.com/site/fin/gfo/GlobalProcesses/cnt452504.pdf For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.