0. Release Notes (2.0.x)
2.0.0
Pekko HTTP 2.0.0 and Pekko 2.0.0 are not binary compatible with their 1.x releases. Libraries built against Pekko 1.x or Pekko HTTP 1.x cannot be trusted to work with Pekko HTTP 2.x, and need to be rebuilt and released for Pekko 2.x. See the Pekko 2.0 release notes for the binary compatibility changes in the core Pekko modules.
Release notes for Apache Pekko HTTP 2.0.0. This is the first release of a new major version and includes the changes from the 2.0.0-M1 and 2.0.0-M2 milestone releases. See the GitHub milestones for 2.0.0-M1, 2.0.0-M2 and 2.0.0-M3 for a fuller list of changes.
Pekko HTTP 2.0.0 is not binary compatible with Pekko HTTP 1.x. Read the migration guide before upgrading. It lists the API, behavior and configuration changes, including the changed default values.
Main changes
- Pekko 2.0.0 is the new minimum Pekko version
- Java 17 is the new minimum Java version
- Scala 2.12 support has been dropped
- Deprecated code has been removed, including a number of util classes for Scala version compatibility
- HTTP/2 is enabled by default for servers bound with
Http().newServerAt(...).bind(...)(PR928) - The rate of incoming
RST_STREAMframes, and of empty DATA frames that do not end their stream, is limited by default on HTTP/2 server and client connections (PR1193, PR1265, PR1394). A connection that exceeds the limit is closed withGOAWAY(ENHANCE_YOUR_CALM)(PR1413) getFromResourcerejects resource names that contain a..segment, a backslash or a NUL character by default; setpekko.http.routing.reject-unsafe-resource-names = offto restore the 1.x behavior (PR1406)- Jackson 3 is supported in the new
pekko-http-jackson3module (PR837) - Java DSL methods that returned Scala Durations now return Java Durations (PR788)
Additions
zstdcontent coding (Coders.Zstd), with a decoder window limited to 8 MB as RFC 9659 requires. It is not part ofCoders.DefaultCodersand needs the optionalcom.github.luben:zstd-jnidependency (1.5.7-25 or later) (PR1391)Coders.decodeMessage(message, decoders)and Java DSLCoder.decodeResponse/Coder.decodeRequestdecode a message with the decoder matching itsContent-Encoding(PR1391)- Server-side WebSocket compression (PR1114)
- WebSocket
receive-idle-timeoutandsend-idle-timeoutsettings (PR1369) max-connection-agesettings for HTTP/2 server connections (PR1316)- Client-side maximum connection age for HTTP/2 managed persistent connections (PR1320)
HttpMessage.header(name)for case-insensitive header lookup by name (PR1366)
Java DSL improvements
- Use
java.time.Durationin Java DSLServerSettingstimeouts (PR1373) - Add
onCompleteoverloads with aCompletionStage.handlestyle callback (PR1375) - Add connection pool flows that emit
HttpResponseResultinstead ofscala.util.Try(PR1376) ConnectionPoolSettings.withHostOverridestakesjapi.Pairinstead ofscala.Tuple2(PR1377)- Add
java.lang.Iterableoverloads toTrailer.addHeadersandwithHeaders(PR1374) - Accept wildcard generic types in Java API parameters (PR1379, PR1380, PR1381, PR1382, PR1384)
- Remove
@ApiMayChangefrom client transport, request/response association and some directive APIs (PR1364) HttpMessage.attributeandResponseEntity.fromJavano longer require a privateJavaMappingimplicit (PR1340)
Bug Fixes
- Reject control bytes in the request line, and malformed HTTP/2
:schemepseudo-headers and field names (PR1341) - HTTP/2: send
:schemeand:authorityfor a request with a relative URI (PR1342) - HTTP/2: reject uppercase field names and field values with surrounding whitespace (PR1343)
- Drop chunk extensions containing NUL, not only CR or LF (PR1344)
- Escape control characters in logged parse-error details (PR1294)
- Close a pool connection after an early response, and abort the upload only if the request was rejected (PR1350)
- Quote
Linkheader parameter values containing a colon (PR1365) - HTTP/2: emit a failed response for the triggering request when a persistent connection gives up (PR1368)
- Accept whitespace before the separator, and empty elements, in HTTP header lists (PR1395, PR1407)
- Preserve pending responses during server shutdown (PR1398, PR1400)
This release also includes the bug fixes from the Pekko HTTP 1.4.x releases. See the 1.4 release notes.
Performance
- Huffman decode HPACK string literals into reusable scratch arrays (PR1302)
- Copy ASCII bytes with the bulk
String.getBytes(PR1299)
Dependency Changes
Most of the dependency changes are small patch level upgrades. Some exceptions include:
- Pekko 2.0.0
- Jackson 2.23.0
- Jackson 3.3.0 (new
pekko-http-jackson3module) - scala-xml 2.5.0