Release Notes (2.0.x)
2.0.0
Pekko gRPC 2.0.0 is not binary compatible with Pekko gRPC 1.x. It requires Pekko 2.0.x and Pekko HTTP 2.0.x, which are not binary compatible with their 1.x releases either. Libraries built against Pekko gRPC 1.x need to be rebuilt and released for Pekko gRPC 2.x.
Regenerate all gRPC code with the 2.x build plugin. Code generated by a 1.x plugin, or by a 2.0.0 milestone, does not work with the 2.x runtime. See the migration guide.
Release notes for Apache Pekko gRPC 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.
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 and Pekko HTTP 2.0.0 are the new minimum versions
- Java 17 is the new minimum Java version
- Scala 2.12 is no longer supported for the runtime library; the sbt plugin is still built for sbt 1.x (Scala 2.12)
- protobuf-java 4.x (up from 3.25.x), together with ScalaPB 1.0.0 (PR610, PR854)
- Deprecated code removed (PR502)
- Java DSL APIs use
pekko.japi.function.Functioninstead of the deprecatedpekko.japi.Function(PR484) - Server reflection uses the
grpc.reflection.v1protocol instead ofv1alpha(PR599) - The sbt plugin supports sbt 1 and sbt 2 (PR710) and is published in the non-legacy Maven style (PR736)
- The Maven plugin uses
io.github.blackrockprotoc-jar 3.0.0 instead of the unmaintainedcom.github.os72equivalent (PR709) - The pekko-http client backend verifies the server hostname against its TLS certificate by default (PR820, PR830, PR857)
- Inbound messages are limited to 4 MiB by default, on both the client and the server (PR818)
- The default gRPC-Web CORS settings no longer allow credentials from any origin (PR871)
Additions
- Rich error model client API (PR645)
- Server reflection sends transitive dependencies (PR643)
- Set a deadline per call with
setDeadlineon the request builders (PR922) - The server honours
grpc-timeout, and the pekko-http client sends it (PR824, PR872) - Client-side request compression with the
compressionclient setting (PR927) deflatemessage compression (PR926)minimum-tls-versionclient setting (PR823)max-inbound-message-sizeclient and server settings (PR818, PR877)- Generated Scala sources can use Scala 3 syntax with the
scala3_sourcesoption, and the Gradle plugin has ascala3Sourcesoption (PR597, PR770). Code that passes the actor system to generated clients explicitly needs a change on Scala 3, see the migration guide
Java DSL improvements
- Accept
Iterables and wildcard generic types in Java API collection parameters (PR935) - Avoid unnecessary map conversions in the Java DSL (PR520, PR522)
Bug Fixes
- Fix
Codecs.negotiate()dropping supported encodings with whitespace (PR850) - Fix trailer frame handling in
GrpcProtocol(PR822) - Percent-decode
grpc-messageon the pekko-http client (PR869) - Report malformed response headers as a gRPC status (PR870)
- Do not return
NotImplementedErrorandUnsupportedOperationExceptionmessages to the caller (PR874) - Replace the resolver’s
assertwith anIllegalArgumentException(PR873) - Cancel server streams in the pekko-http client backend (PR921)
- Avoid an NPE for a
StatusRuntimeExceptionwithout trailers (PR920) - Guard against division by zero in
PekkoHttpClientUtils(PR819) - Clean up Netty SSL context creation (PR707)
- sbt plugin: consistently include proto files in built artifacts (PR746)
- sbt plugin: avoid duplicate gRPC resource directories (PR895)
- Maven plugin: pass all
protoPathsas-Iimport parameters to protoc (PR773) - Maven plugin: recompute proto paths after module reconfiguration (PR949)
- Maven plugin: return a more helpful error message when the temporary directory is mounted
noexec(PR682) - Gradle plugin: use a relative path for
logfile_encto fix build cache relocatability (PR661)
Performance
- Improved and simplified unary server handlers (PR686, PR905)
- Encode response data frames through
GrpcProtocolWriterwith deferred writes (PR909) - Avoid buffer copies with a non-synchronized
ByteStringOutputStream(PR907) - Reduce memory usage in
ByteStringUtil(PR826) - Use
FastFuturefor already completed futures (PR390, PR863)
Dependency Changes
Most of the dependency changes are small patch level upgrades. Some exceptions include:
- Pekko 2.0.0
- Pekko HTTP 2.0.0
- grpc-java 1.85.1
- protobuf-java 4.36.2
- ScalaPB 1.0.0-alpha.6
- sbt-protoc 1.1.0-RC2
- protoc-jar 3.0.0 (
io.github.blackrock)