(creating a new topic here since akka-grpc github issue template asked me to do so)
To short, I am looking for the way to properly bind multiple power-apis to akka-http routes.
The current problem I’ve faced is the routes are returning 404s (including REST endpoints, not only gRPC endpoints) instead of those from error handlers, when more than 1 power-api routes are added like below. When I comment either of grpcRoutes
or grpcHealthRoute
it starts working (e.g. returning 401 when not authorized instead of 404)
I tried to follow the instructions here, and realized the power-apis do not have service descriptor generated, so I couldn’t find the way to set up the server reflection service.
The akka-http route code is:
val routes =
handleExceptions(exceptionHandler) {
handleRejections(rejectionHandler) {
concat(
restRoutes.healthCheckRoutes,
restRoutes.swaggerRoutes,
checkAuth(restRoutes.topRoutes),
checkAuth(grpcRoutes),
grpcHealthRoute
)
}
}
The gRPC routes are defined like:
def healthRoute()(implicit system: ActorSystem[_]): Route = {
val gRpcHealthHandler = FooHealthPowerApiHandler.partial(new FooHealthPowerApiImpl)
handle(gRpcHealthHandler)
}
on application.conf:
// ...
akka {
http {
server.preview.enable-http2 = on
}
}
on build.sbt:
lazy val root = (project in file("."))
.enablePlugins(AkkaGrpcPlugin, JavaAppPackaging, DockerPlugin, EcrPlugin)
akkaGrpcGeneratedSources := Seq(AkkaGrpc.Client, AkkaGrpc.Server)
akkaGrpcCodeGeneratorSettings += "server_power_apis"
akka-http version: 10.2.6
sbt-akka-grpc: 2.0.0
Is there way to bind multiple power-apis? should I also generate normal gRPC service like below?
akkaGrpcCodeGeneratorSettings ++= Seq("server_power_apis", "grpc")