Interface GrpcMessageCompressorService


public interface GrpcMessageCompressorService

A message compressor service allows to resolve gRPC message compressors from message encodings.

This service shall concentrate all GrpcMessageCompressor instances injected in the module. A client or a server relies on this service to determine which compressor must be used to compress or uncompress messages based on GrpcHeaders.NAME_GRPC_ACCEPT_MESSAGE_ENCODING or GrpcHeaders.NAME_GRPC_MESSAGE_ENCODING headers.

Since:
1.9
Author:
Jeremy Kuhn
  • Method Details

    • getMessageCompressor

      Optional<GrpcMessageCompressor> getMessageCompressor(String... messageEncodings)

      Returns the first available gRPC message compressor matching the specified list of message encodings.

      Parameters:
      messageEncodings - a list of message encodings by order of preference
      Returns:
      an optional returning the message compressor or an empty optional if no compressor was found or the specified list of encodings was null or empty
    • getMessageEncodings

      Set<String> getMessageEncodings()

      Returns the list of supported message encodings.

      Returns:
      a list of message encodings