Hi all,

I have a very simple requirement that is to compress the responses from one 
of my server methods, but none of my attempts seem to work.

At first this seemed to be the solution, but no success.
https://stackoverflow.com/questions/49031763/grpc-compression-in-c-sharp

Basically no matter what I try, the server always prints in the logs: 
"Algorithm 'gzip' enabled but decided not to compress. Input size: 900008".

I also get the error that the previously linked post was talking about:
"prepare_application_metadata: 
{"created":"@1553495392.669243000","description":"Unallowed duplicate 
metadata","file":"/tmpfs/src/github/grpc/workspace_csharp_ext_macos_x64/src/core/lib/transport/metadata_batch.cc","file_line":113,"key":"grpc-internal-encoding-request","value":"gzip"}"

I have a simple server + service that only has one request.

I've tried various combinations of the following:
- setting server side ChannelOption "default_compression_level" to Low.
- adding the following to my service method:

var headers = new Metadata{new Metadata.Entry(
"grpc-internal-encoding-request", "gzip")};
await context.WriteResponseHeadersAsync(headers);


- the following as either a call option and/or channel options: 

new Metadata.Entry("grpc-internal-encoding-request", "gzip")


The things is, server side always logs that it "decided not to compress".

My log settings are: GRPC_TRACE=compression;GRPC_VERBOSITY=DEBUG

My question is, what is the correct combination to get the server to reply 
with a compressed payload ?

Thanks
Sam

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/26b31807-737f-4dcc-bb2a-eff9d13657b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to