diff --git a/protobuf/src/main/java/io/grpc/protobuf/ProtoUtils.java b/protobuf/src/main/java/io/grpc/protobuf/ProtoUtils.java index 00421de102..b541e2f820 100644 --- a/protobuf/src/main/java/io/grpc/protobuf/ProtoUtils.java +++ b/protobuf/src/main/java/io/grpc/protobuf/ProtoUtils.java @@ -37,7 +37,15 @@ public class ProtoUtils { public static Metadata.Key keyForProto(T instance) { return Metadata.Key.of( instance.getDescriptorForType().getFullName() + Metadata.BINARY_HEADER_SUFFIX, - ProtoLiteUtils.metadataMarshaller(instance)); + metadataMarshaller(instance)); + } + + /** + * Produce a metadata marshaller for a protobuf type. + */ + @ExperimentalApi("https://github.com/grpc/grpc-java/issues/4477") + public static Metadata.BinaryMarshaller metadataMarshaller(T instance) { + return ProtoLiteUtils.metadataMarshaller(instance); } private ProtoUtils() {