Is it possible to customize the compression algorithm in gRPC when using C++?

86 views
Skip to first unread message

梁宪松

unread,
Jan 8, 2021, 7:41:46 AM1/8/21
to grpc.io
golang can register a custom compressor like this

```
grpc.UseCompressor(gzip.Name)
```

In C++ there is just support of several compression algorithms:

```
ChannelArguments args; // Set the default compression algorithm for the channel. 
// gzip deflate ...
args.SetCompressionAlgorithm(GRPC_COMPRESS_GZIP); GreeterClient greeter(grpc::CreateCustomChannel( "localhost:50051", grpc::InsecureChannelCredentials(), args));
```

How to add a customize "compressor" like golang?


Lidi Zheng

unread,
Jan 13, 2021, 1:02:40 PM1/13/21
to grpc.io

gRPC C++ is a wrapper over gRPC Core. All available compression algorithm can be found at https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/compression_types.h.

However, currently there is no way to customize compression algorithm. If this is critical to you, feel free to file a feature request on GitHub: https://github.com/grpc/grpc/issues
Reply all
Reply to author
Forward
0 new messages