SlideShare a Scribd company logo
Http/1.1 vs HttP/2
Client Java
Presented By: Kunal Sethi
Software Consultant
Knoldus Inc.
LEARN NOW
● Http/2 Protocol
● Http/2 Client Introduction
● Main components of Http/2 (new API)
● Why Http/2 Client
● Diff b/w Http/1.1 and Http/2 Client
● Demo
Agenda
● In 2015, Internet Engineering Task Force (IETF) release HTTP/2,
the second major version of the most useful internet protocol,
HTTP. It was derived from the earlier experimental SPDY
protocol.
● Main goals of developing HTTP/2 was:
● High-level compatibility with HTTP/1.1 — methods, status codes, URIs
and header fields.
● Compression of request headers
● HTTP/2 Server Push
What is Http/2 ?
● The HTTP Client module is bundled as an incubator module
in JDK 9 and supports HTTP/2 with backward compatibility still
facilitating HTTP/1.1.
● To use it, we need to define our module using a module-info.java
file which also indicates the required module to run our
application:
module com.baeldung.java9.httpclient {
requires jdk.incubator.httpclient;
}
Http/2 Client Introduction
The API consists of 3 core classes:
● HttpRequest
● HttpClient
● HttpResponse
Main components of new API
● represents the request to be sent via the HttpClient.
● The best part of this new API is they are focusing on immutable
pattern as well. We can use the builder pattern to create the
request instance which is immutable so, it is thread safe.
● Methods of HttpRequest:
HttpRequest
● behaves as a container for configuration information common to
multiple requests.
● In Client they are also using immutable concept. We can use the
builder pattern to create the client instance.
● Methods of HttpClient:
HttpClient
● This represents the result of an HttpRequest call. This is the
response from the server which you have request in the form of
HttpRequest through the HttpClient.
● Methods of HttpResponse:
HttpResponse
● Until very recently, Java provided only the HttpURLConnection
API – which is low-level and isn’t known for being feature-rich and
user-friendly.
● Therefore, some widely used third-party libraries were commonly
used – such as Apache HttpClient, Jetty, and Spring’s
RestTemplate.
Why Http/2 Client
● Supports Http2
● Easy to use
● Can send Asynchronous request
● Many more new methods which actually this new API provides.
● No need to explicitly cast the connection.
● Can write code in more readable form.
Difference between Http/1.1 & Http/2 Client
Demo
Q/A
If you have questions please ask me @
➔ kunal.sethi@knoldus.in
References:
● https://docs.oracle.com/javase/10/docs/api/jdk/incubator/http/HttpClient.html
● https://www.baeldung.com/java-9-http-client
About Knoldus
Knoldus is a technology consulting firm with focus on modernizing the digital systems
at the pace your business demands.
DevOps
Functional. Reactive. Cloud Native
Thank You!
@kunals201
kunal.sethi@knoldus.in

More Related Content

PPTX
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
PDF
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
PPTX
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
PDF
Angular Libraries & NPM
PDF
Hidden Dragons of CGO
PPTX
Polyglot Mule Transformers
PPTX
Indy meetup#7 effective unit-testing-mule
PPTX
Meetup presentation-june26
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
Angular Libraries & NPM
Hidden Dragons of CGO
Polyglot Mule Transformers
Indy meetup#7 effective unit-testing-mule
Meetup presentation-june26

What's hot (19)

PDF
Android application architecture
PPT
Gwt Presentation1
PPTX
Mulesoft KL Meetup 2
PDF
MuleSoft Surat Virtual Meetup#33 - Unleash the power of Anypoint MQ and DLQ
PPTX
WebSDK - Switching between service providers
ODP
Adopting Debug Adapter Protocol in Eclipse IDE: netcoredbg (.NET debugger) ca...
PDF
User Forms & API integration
PPTX
Asp.net c# MVC-5 Training-Day-2 of Day-9
PDF
MuleSoft Surat Virtual Meetup#34 - OAS 3.0 full API lifecycle support with An...
PPTX
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
PDF
MuleSoft Surat Virtual Meetup#32 - Implementing Command and Query Responsibil...
ODP
Docker - An Introduction
PDF
Closure Library: Build Complex JavaScript Applications
PDF
React.js vs node.js
PPTX
The New York Times: Sustainable Systems, Powered by Python
PDF
Android Modularization
PPTX
Advent of magento2
PPTX
Server Side Programming
PDF
Milos Marinkovic "Modular Android UI"
Android application architecture
Gwt Presentation1
Mulesoft KL Meetup 2
MuleSoft Surat Virtual Meetup#33 - Unleash the power of Anypoint MQ and DLQ
WebSDK - Switching between service providers
Adopting Debug Adapter Protocol in Eclipse IDE: netcoredbg (.NET debugger) ca...
User Forms & API integration
Asp.net c# MVC-5 Training-Day-2 of Day-9
MuleSoft Surat Virtual Meetup#34 - OAS 3.0 full API lifecycle support with An...
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
MuleSoft Surat Virtual Meetup#32 - Implementing Command and Query Responsibil...
Docker - An Introduction
Closure Library: Build Complex JavaScript Applications
React.js vs node.js
The New York Times: Sustainable Systems, Powered by Python
Android Modularization
Advent of magento2
Server Side Programming
Milos Marinkovic "Modular Android UI"
Ad

Similar to Webinar: Draw a line between HTTP/2 client and HTTP Client (20)

PDF
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
PPTX
The new (is it really ) api stack
PDF
WSO2 API Microgateway for Easier Development and Greater Scalability
PPT
JUG louvain websockets
PDF
KrakenD API Gateway
PPTX
PDF
Declarative Clients in Spring
PDF
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
PDF
Monkey Server
PDF
Apigility introduction v2 (glasgow php)
PPTX
java Servlet technology
PPTX
How to build Simple yet powerful API.pptx
PDF
Productivity Acceleration Tools for SOA Testers
ODP
Microservices
PPTX
Yotpo microservices
PPTX
PDF
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
PDF
Introduction to Apigility
PPTX
Ultimate Guide to Microservice Architecture on Kubernetes
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
The new (is it really ) api stack
WSO2 API Microgateway for Easier Development and Greater Scalability
JUG louvain websockets
KrakenD API Gateway
Declarative Clients in Spring
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Monkey Server
Apigility introduction v2 (glasgow php)
java Servlet technology
How to build Simple yet powerful API.pptx
Productivity Acceleration Tools for SOA Testers
Microservices
Yotpo microservices
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Introduction to Apigility
Ultimate Guide to Microservice Architecture on Kubernetes
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
PPTX
Self-Healing Test Automation Framework - Healenium
PPTX
Kanban Metrics Presentation (Project Management)
PPTX
Java 17 features and implementation.pptx
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
PPTX
GraalVM - A Step Ahead of JVM Presentation
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
DAPR - Distributed Application Runtime Presentation
PPTX
Introduction to Azure Virtual WAN Presentation
PPTX
Introduction to Argo Rollouts Presentation
PPTX
Intro to Azure Container App Presentation
PPTX
Insights Unveiled Test Reporting and Observability Excellence
PPTX
Introduction to Splunk Presentation (DevOps)
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
PPTX
AWS: Messaging Services in AWS Presentation
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
PPTX
Managing State & HTTP Requests In Ionic.
Angular Hydration Presentation (FrontEnd)
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Self-Healing Test Automation Framework - Healenium
Kanban Metrics Presentation (Project Management)
Java 17 features and implementation.pptx
Chaos Mesh Introducing Chaos in Kubernetes
GraalVM - A Step Ahead of JVM Presentation
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
DAPR - Distributed Application Runtime Presentation
Introduction to Azure Virtual WAN Presentation
Introduction to Argo Rollouts Presentation
Intro to Azure Container App Presentation
Insights Unveiled Test Reporting and Observability Excellence
Introduction to Splunk Presentation (DevOps)
Code Camp - Data Profiling and Quality Analysis Framework
AWS: Messaging Services in AWS Presentation
Amazon Cognito: A Primer on Authentication and Authorization
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Managing State & HTTP Requests In Ionic.

Recently uploaded (20)

PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
MYSQL Presentation for SQL database connectivity
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Spectroscopy.pptx food analysis technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
A comparative analysis of optical character recognition models for extracting...
Review of recent advances in non-invasive hemoglobin estimation
MYSQL Presentation for SQL database connectivity
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25-Week II
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Unlocking AI with Model Context Protocol (MCP)
Spectroscopy.pptx food analysis technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
Diabetes mellitus diagnosis method based random forest with bat algorithm
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Webinar: Draw a line between HTTP/2 client and HTTP Client

  • 1. Http/1.1 vs HttP/2 Client Java Presented By: Kunal Sethi Software Consultant Knoldus Inc. LEARN NOW
  • 2. ● Http/2 Protocol ● Http/2 Client Introduction ● Main components of Http/2 (new API) ● Why Http/2 Client ● Diff b/w Http/1.1 and Http/2 Client ● Demo Agenda
  • 3. ● In 2015, Internet Engineering Task Force (IETF) release HTTP/2, the second major version of the most useful internet protocol, HTTP. It was derived from the earlier experimental SPDY protocol. ● Main goals of developing HTTP/2 was: ● High-level compatibility with HTTP/1.1 — methods, status codes, URIs and header fields. ● Compression of request headers ● HTTP/2 Server Push What is Http/2 ?
  • 4. ● The HTTP Client module is bundled as an incubator module in JDK 9 and supports HTTP/2 with backward compatibility still facilitating HTTP/1.1. ● To use it, we need to define our module using a module-info.java file which also indicates the required module to run our application: module com.baeldung.java9.httpclient { requires jdk.incubator.httpclient; } Http/2 Client Introduction
  • 5. The API consists of 3 core classes: ● HttpRequest ● HttpClient ● HttpResponse Main components of new API
  • 6. ● represents the request to be sent via the HttpClient. ● The best part of this new API is they are focusing on immutable pattern as well. We can use the builder pattern to create the request instance which is immutable so, it is thread safe. ● Methods of HttpRequest: HttpRequest
  • 7. ● behaves as a container for configuration information common to multiple requests. ● In Client they are also using immutable concept. We can use the builder pattern to create the client instance. ● Methods of HttpClient: HttpClient
  • 8. ● This represents the result of an HttpRequest call. This is the response from the server which you have request in the form of HttpRequest through the HttpClient. ● Methods of HttpResponse: HttpResponse
  • 9. ● Until very recently, Java provided only the HttpURLConnection API – which is low-level and isn’t known for being feature-rich and user-friendly. ● Therefore, some widely used third-party libraries were commonly used – such as Apache HttpClient, Jetty, and Spring’s RestTemplate. Why Http/2 Client
  • 10. ● Supports Http2 ● Easy to use ● Can send Asynchronous request ● Many more new methods which actually this new API provides. ● No need to explicitly cast the connection. ● Can write code in more readable form. Difference between Http/1.1 & Http/2 Client
  • 11. Demo
  • 12. Q/A If you have questions please ask me @ ➔ kunal.sethi@knoldus.in
  • 14. About Knoldus Knoldus is a technology consulting firm with focus on modernizing the digital systems at the pace your business demands. DevOps Functional. Reactive. Cloud Native