Quantcast
Channel: Akka Libraries - Discussion Forum for Akka technologies
Viewing all articles
Browse latest Browse all 1365

Use client-side http2 in akka-http_2.13 v10.1.12

$
0
0

Can anyone tell me what is the correct way to launch a http2 request with akka-http?
The doc website says I have to

Http.get(system)
        .connectionTo("127.0.0.1")
        .toPort(8443)
        .http2();

But in the akka-http version I use (akka-http_2.13 v10.1.12) there isn’t a method called connectionTo() in the akka.http.javadsl.Http class. (Plus I don’t know why the official javadoc doesn’t include akka-http_2.13 so it’s super hard to find any documentation)

I’m trying to launch http2 requests because I’m stuck on this error after migrating from akka-http_2.11 to akka-http_2.13, and I’m guessing it might because the server I’m sending requests to default with http2:

[ERROR] [07/08/2021 05:58:57.732] [graph-api-akka.actor.default-dispatcher-19] [akka://graph-api/system/Materializers/StreamSupervisor-2/flow-6-0-PoolFlow] Error in stage [akka.http.impl.engine.client.OutgoingConnectionBlueprint$PrepareResponse@25f31b7]: The server-side HTTP version is not supported
akka.http.scaladsl.model.IllegalResponseException: The server-side HTTP version is not supported
     at akka.http.impl.engine.client.OutgoingConnectionBlueprint$PrepareResponse$$anon$3.onPush(OutgoingConnectionBlueprint.scala:191)
     at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:541)
     at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:423)
     at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:625)
     ...

And it is really painful for me to debug. The API server I’m requesting, Facebook Graph API, should support both http1.1 and http2. So I can’t figure out why I got The server-side HTTP version is not supported. Or is there anything I can do in my akka-http code to force the requests to be http1.1?

Thank you so much for your time to help!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1365

Trending Articles