Akka gRPC/HTTP Interop giving 404

Hello, I have an application running a gRPC service alongside a simple Akka HTTP endpoint. I am following this guide: Akka HTTP interop • Akka gRPC. The problem: when curling the HTTP endpoint I get 404 not found. I know it found the server because Akka-HTTP/10.2.5 is the server of the response header.

Some code:

object Server extends App {
        val conf = ConfigFactory
            .parseString("akka.http.server.preview.enable-http2 = on")
        val system = ActorSystem("Interop", conf)
        new Server(system).run()

class Server(system: ActorSystem) {
    def run() = {
        // implicit sys, ec...
        val grpcService: HttpRequest => Future[HttpResponse] = ServiceHandler(new Service())
        val greeter = get {
            pathEndOrSingleSlash {
                complete("I am alive")
        // lifted this line straight out of the guide
        val grpcRoute = { ctx => grpcService(ctx.request).map(RouteResult.Complete) }
        val route = concat(greeter, grpcRoute)
        val binding = Http().newServerAt("", 8080).bind(route)

When I take out the gRPC route, the greeter endpoint works as intended. Otherwise, when I curl http://localhost:8080, I get

*Mark bundle as not supporting multiuser
<HTTP/1.1 404 Not Found
<Server: akka-http/10.2.5

I am using akka-gRPC 2.0.0

What should I do to ensure interop between the two routes?

Hi @nsadeh,

from a first glance, your code seems correct. Does it work if you use val route = greeter instead?


Hi Johannes, yes it does. I think it’s an HTTP2 vs 1 issues. What I ended up doing for now is creating a second binding for my REST server. Now my app is listening on 2 ports. It’s not clean but this is for a MVP so it will have to do. If I push to production I will also deploy a gateway.