Akka gRPC exposes an ActorSystem through gRPC ports, letting external applications call Akka-backed services over HTTP/2. It supports both generated clients and servers, with Protocol Buffers defining the service boundary. section 11.0 section 11.2
A typical Akka gRPC integration follows these steps:
- Add and enable the Akka gRPC sbt plugin, together with Akka HTTP, Akka Streams, service discovery, and HTTP/2 support. section 11.2.3
- Place a .proto file under src/main/proto and define messages, package options, and RPC methods such as ContainerService.AddCargo. section 11.2.3
- Compile the project to generate Scala message classes, a client, and a server trait with protobuf marshallers. section 11.2.3 section 11.3
- Extend the generated server, bind it to the application, and forward requests to actors with ask or tell. section 11.3
Container service
A unary AddCargo RPC accepts a Cargo message containing kind and size, then returns AddedCargo with an ok Boolean. After starting the service, grpcurl can add a bigbag and a sack, then call GetCargos and receive both cargo records. section 11.2.3 section 11.2.7
Betting-house ports
A betting application can use gRPC ports for market and bet updates when order guarantees matter. A gRPC stream provides that behavior, while wallet access can use Akka HTTP; reflection exposes available calls. section 12.2
