Create NoPublish sbt plugin
2 files changed
tree: 0586338775cf02d0c8c32242c958e14553075a4f
  1. .github/
  2. benchmark-java/
  3. benchmarks/
  4. codegen/
  5. docs/
  6. gradle-plugin/
  7. interop-tests/
  8. maven-plugin/
  9. plugin-tester-java/
  10. plugin-tester-scala/
  11. project/
  12. runtime/
  13. sbt-plugin/
  14. scalapb-protoc-plugin/
  15. scripts/
  16. .asf.yaml
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .jvmopts-ci
  21. .scala-steward.conf
  22. .scalafmt.conf
  23. build.sbt
  27. NOTICE

Apache Pekko gRPC

Support for building streaming gRPC servers and clients on top of Apache Pekko Streams.

This library is meant to be used as a building block in projects using the Pekko toolkit.


Project Status

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 Pekko Streams-based one.

The client side is currently implemented on top of io.grpc:grpc-netty-shaded, we plan to replace this by just io.grpc:grpc-core and @extrefPekko HTTP.

As for performance, we are currently relying on the JVM TLS implementation, which is sufficient for many use cases, but is planned to be replaced with conscrypt or netty-tcnative.

General overview

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, pekko-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 Pekko Streams Sources
  • On the server side, code to create a Pekko HTTP route based on your implementation of the API
  • On the client side, a client for the API.

Project structure

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

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. See the note in the Akka HTTP docs.


Pekko gRPC is Open Source and available under the Apache 2 License.