Support for building streaming gRPC servers and clients on top of Akka Streams.
This library is meant to be used as a building block in projects using the Akka toolkit.
- Akka gRPC reference documentation
This library is ready to be used in production, but API's and build system plugins are still expected to be improved and may change.
The API on both sides (Client and Server) is a simple Akka Streams-based one.
gRPC is a schema-first RPC framework, where your protocol is declared in a protobuf definition, and requests and responses will be streamed over an HTTP/2 connection.
Based on a protobuf service definition, akka-grpc can generate:
- Model classes (using plain protoc for Java or scalapb for Scala)
- The API (as an interface for Java or a trait for Scala), expressed in Akka Streams
- On the server side, code to create an Akka HTTP route based on your implementation of the API
- On the client side, a client for the API.
The project is split up in a number of subprojects:
- codegen: code generation shared among plugins
- runtime: run-time utilities used by the generated code
- sbt-plugin: the sbt plugin
- scalapb-protoc-plugin: the scalapb Scala model code generation packaged as a protoc plugin, to be used from gradle
- interop-tests: test interoperability between the Akka implementation and the implementation from
io.gpc:grpc-interop-testing, based on gRPC's original testset. These tests are duplicated as more faithful 'scripted' tests under the sbt-project module.
Additionally, 'plugin-tester-java' and 'plugin-tester-scala' contain an example project in Java and Scala respectively, with both sbt and Gradle configurations.
Compatibility & support
If used with JDK 8 prior to version 1.8.0_251 you must add an ALPN agent.
Support for Akka gRPC is available via the Lightbend Subscription
Akka gRPC is Open Source and available under the Apache 2 License.