Skip to content

Commit

Permalink
fix(kt): enable gRPC server compression (#569)
Browse files Browse the repository at this point in the history
Per gRPC docs referencing [this
code](https://github.com/grpc/grpc-java/blob/master/examples/src/main/java/io/grpc/examples/experimental/CompressingHelloWorldServerAllMethods.java).

```
🐚 ~/dev/ftl $ ftl call alice.echo
{"message":"Hello, null!"}
🐚 ~/dev/ftl $ ftl call bob.echo
{"message":"Hello, null! Hello, testing123!"}
```
  • Loading branch information
alecthomas authored Nov 8, 2023
1 parent c67cf98 commit 96a7a6d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
install-jars: && install-generator-jar install-runtime-jar
mvn install

install-generator-jar:
mvn -pl :ftl-generator install

install-runtime-jar:
mvn -pl :ftl-runtime install
1 change: 1 addition & 0 deletions bin/.just-1.15.0.pkg
1 change: 1 addition & 0 deletions bin/just
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ internal class ServerInterceptor : ServerInterceptor {
headers: Metadata?,
next: ServerCallHandler<ReqT, RespT>?
): ServerCall.Listener<ReqT> {
call?.setCompression("gzip")

var context = Context.current()

headers?.getAll(callersMetadata)?.apply {
Expand Down

0 comments on commit 96a7a6d

Please sign in to comment.