roadrunner-server / roadrunner-plugins

📦 Home for the roadrunner plugins
MIT License
25 stars 9 forks source link

[💡 FEATURE REQUEST]: Support for the `gzip` gRPC codec #191

Closed hetao29 closed 2 years ago

hetao29 commented 2 years ago

No duplicates 🥲.

What happened?

when my gRPC Client enabled the GzipCodec, then client got the error

my client code:

import 'package:grpc/grpc.dart';
import 'package:helloworld/src/generated/helloworld.pbgrpc.dart';

Future<void> main(List<String> args) async {
  final channel = ClientChannel(
    'localhost',
    port: 50000,
    options: ChannelOptions(
      credentials: ChannelCredentials.insecure(),
      codecRegistry: CodecRegistry(codecs: const [GzipCodec(), IdentityCodec()]),
    ),
  );
  final stub = GreeterClient(channel);

  final name = args.isNotEmpty ? args[0] : 'world';

  try {
    final response = await stub.sayHello(
      HelloRequest()..name = name,
      options: CallOptions(compression: const GzipCodec()),
    );
    print('Greeter client received: ${response.message}');
  } catch (e) {
    print('Caught error: $e');
  }
  await channel.shutdown();
}

the error info:

Caught error: gRPC Error (code: 12, codeName: UNIMPLEMENTED, message: grpc: Decompressor is not installed for grpc-encoding "gzip", details: [], rawResponse: null, trailers: {})

Version

2.x

Relevant log output

No response

rustatian commented 2 years ago

Hey @hetao29, thanks for the report. In the current version, we operate with non-gzipped payloads. Will add it in the RR 2.8. Does it work without the GzipCodec()?

hetao29 commented 2 years ago

Hey @hetao29, thanks for the report. In the current version, we operate with non-gzipped payloads. Will add it in the RR 2.8. Does it work without the GzipCodec()?

It work without the GzipCodec()

rustatian commented 2 years ago

Good, I'll add gzip codec in the upcoming release, please stay tuned 👍🏻