jmeter-http2-sampler
HTTP2 Plugin for JMeter
Inspired by BlazeMeter HTTP2 Plugin but with JDK11+ HTTPClient under hood + GraphQL Sampler
This plugin provides an HTTP2 Sampler and a HTTP2 Controller in order to test you HTTP/2 endpoint.
IMPORTANT: Java 21 required
To create your test:
-
Install the HTTP/2 plugin jar library to lib/ext.
-
Create a Thread Group.
-
Add the HTTP2 Sampler (Add-> Sampler-> HTTP2 Request).

After that you can add timers, assertions, listeners, etc.
Configuring the HTTP2 Sampler:
Let's explain the HTTP2 Sampler fields:
Basic tab:

| Field | Description | Default |
|---|---|---|
| Protocol | Choose HTTP or HTTPS | HTTP |
| Server name or IP | The domain name or IP address of the web server. [Do not include the http:// prefix.]. | |
| Port number | The port the web server is listening to | 80 |
| Method | GET, POST, PUT, PATCH, DELETE and OPTIONS are the ones supported at the moment. | |
| Path | The path to resource (For example: ). | |
| Content Encoding | Content encoding to be used (for POST, PUT, PATCH and FILE). This is the character encoding to be used, and is not related to the Content-Encoding HTTP header. | |
| Redirect Automatically | Sets the underlying HTTP protocol handler to automatically follow redirects, so they are not seen by JMeter, and therefore will not appear as samples. | |
| Follow Redirects | If set, the JMeter sampler will check if the response is a redirect and will follow it. The initial redirect and further responses will appear as additional samples. | |
| Use multipart/form-data | Use a or post request | |
| HTTP1 Upgrade | Enables the usage of the Upgrade header for HTTP1 request. (Not enabling this sets HTTP2 as default). |
Advanced tab:

| Field | Description | Default |
|---|---|---|
| Timeouts (milliseconds): | ||
| Connect | Number of milliseconds to wait for a connection to open. | |
| Response | The number of milliseconds to wait for a response. | |
| Proxy Server: | ||
| Scheme | The scheme identifies the protocol to be used to access the resource on the Internet. | http |
| Server name or IP | Hostname or IP address of a proxy server to perform request. [Do not include the http:// prefix]. | |
| Port Number | Port the proxy server is listening to. | |
| Retrieve All Embedded Resources | Allows JMeter to parse the HTML file and send HTTP/HTTPS requests for all images, Java applets, JavaScript files, CSSs, etc. referenced in the file. | |
| Parallel downloads | This feature allows the settings of a concurrent connection pool for retrieving embedded resources as part of the HTTP sampler. | |
| URLs must match | Enables to filter the download of embedded resources that don't match the regular expression set on it. For example, setting this regex , will only download the embedded resources that comes from . |
HTTP/1 Upgrade
When HTTP/1 Upgrade is selected means that the first request made by the plugin will contain all required headers for http1 upgrade.
However, there is a known issue which will send the upgrade when receiving an HTTP1 response even thought the option of HTTP1 Upgrade is not selected. Additionally after the first request which may contain upgrade headers or not (depending on user selection) afterwards all HTTP/1.1 requests made as long as the server responds in HTTP/1.1 will contain upgrade headers.
Buffer capacity
By default, the size of the downloaded resources is set to 2 MB (2097152 bytes) but, the limit can be increased by adding the property on the jmeter.properties file in bytes.
ALPN
The HTTP2 plugin offers Application-Layer Protocol Negotiation (ALPN) support, which facilitates the negotiation of application-layer protocols within the TLS handshake. This enables smooth communication between the client and server by allowing them to agree upon the protocols to be used.
The plugin supports the following protocols for ALPN negotiation:
- HTTP/1.1
- HTTP/2 (over TLS)
For TLS/SSL configuration please refer to SSL Manager and Keystore Configuration
Auth Manager
Currently, we only give support to the Basic and Digest authentication mechanism.
To make use of Basic preemptive authentication results, make sure to create and set the property
to true in the jmeter.properties file.
Embedded Resources
To retrieve all embedded resources asynchronously, you simply need to choose "Parallel Downloads" as the option, unless the value is equal to 1. If you would like to download embedded resources in a synchronous way choose "Parallel Downloads" and set the number to 1.