connectrpc / connect-go

The Go implementation of Connect: Protobuf RPC that works.
https://connectrpc.com
Apache License 2.0
3k stars 100 forks source link

Java support + does connect work with AWS API Gateway and Lambda? #618

Closed skhreshefsharvit closed 11 months ago

skhreshefsharvit commented 1 year ago

Use case: An RPC server written in Go and a client written in Java, running on AWS with AWS API Gateway and Lambda.

Current state: I use Twirp for the RPC server, but it doesn't have a maintained (or a finished) Java library.

I was wondering:

  1. Does ConnectRPC support the combination of API Gateway and Lambda?
  2. Is there a plan to write a Java library anytime soon? or maybe the compatibility with gRPC will make it possible to generate a gRPC client out of the Protobuf and run a connect-go RPC server in Go
akshayjshah commented 1 year ago

The Go implementation of Connect supports three RPC protocols: gRPC, gRPC-Web, and Connect's own protocol. The Connect protocol works anywhere HTTP/1.1 works, so it should work with API Gateway + Lambda. If you have a Twirp server and client working, the Connect protocol will work too. You can call your API from Java using connect-kotlin. Speak on on this poll if you need or want a pure Java implementation.

The gRPC protocol requires support for HTTP trailers, which is often available only with HTTP/2. The last I checked, AWS API gateway <-> Lambda communication is HTTP/1.1-only but I don't know if it handles trailers correctly. If it does support HTTP/1.1 with HTTP trailers, then you can use a grpc-java client with a connect-go Lambda backend for request-response RPCs. The best way to check is to try it :)

akshayjshah commented 11 months ago

@skhreshefsharvit I'm going to close this issue because there doesn't seem to be anything to fix or patch. I hope your Lambda is up and running!