vertx-grpc icon indicating copy to clipboard operation
vertx-grpc copied to clipboard

Support custom Compression/Decompressino

Open MRuecker opened this issue 1 year ago • 6 comments

Describe the feature

We are using the older (Netty) version of the gRPC Server and implemented custom Snappy compression/decompression. We extended the (De)Compressor registry and registered it in the GrpcServer builder via

  • compressorRegistry
  • decompressorRegistry

I couldn't find any option to register custom (de)compressors in grpc-netty

Use cases

This feature is usefull when you need to compress the payload and don't want to use gzip because it's very heavy on CPU. I our case we decided to use Snappy because is comes with a nice balance between CPU usage and compression ratio

Contribution

I'm happy to implement this feature and it might be enough to just allow a custom Compressor/Decompressor Registry to be added to the GrpcServiceBridge and use them instead of the default registries to find the compressor needed. But I'm not sure

Thanks you Markus

MRuecker avatar Jun 19 '23 02:06 MRuecker

I think it's useful, cc @vietj

liangyuanpeng avatar Oct 13 '23 05:10 liangyuanpeng

@MRuecker currently compression is hardcoded in GrpcClientRequest and GrpcServerResponse and only works with GZIP, so you would like to register other compression algorithms ?

vietj avatar Oct 13 '23 07:10 vietj

Yes we are currently using snappy because GZIP is too heavy on CPU

MRuecker avatar Oct 25 '23 01:10 MRuecker

what's the status of this @vietj @MRuecker ?

franz1981 avatar Feb 12 '24 10:02 franz1981

I think we should have support for any compression actually

vietj avatar Feb 12 '24 14:02 vietj

yeah, at least snappy is very used (and I'm recently working with @lucamolteni to get it decent for us as well) and PRs are welcome as you might know ihih, so , join the party!

franz1981 avatar Feb 12 '24 14:02 franz1981