RainYuY commented on code in PR #15616:
URL: https://github.com/apache/dubbo/pull/15616#discussion_r2471649555
##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h12/grpc/GrpcCompositeCodec.java:
##########
@@ -78,12 +85,42 @@ public void loadPackableMethod(MethodDescriptor
methodDescriptor) {
@Override
public void encode(OutputStream outputStream, Object data, Charset
charset) throws EncodeException {
- // protobuf
- // TODO int compressed =
Identity.MESSAGE_ENCODING.equals(requestMetadata.compressor.getMessageEncoding())
? 0 :
- // 1;
try {
- int compressed = 0;
- outputStream.write(compressed);
+ if (packableMethod != null
+ && !packableMethod.needWrapper()
+ && outputStream instanceof ByteBufOutputStream) {
+
+ Pack responsePack = packableMethod.getResponsePack();
+
+ if (responsePack instanceof PbArrayPacker) {
+ PbArrayPacker pbPacker = (PbArrayPacker) responsePack;
+ ByteBufOutputStream bbos = (ByteBufOutputStream)
outputStream;
+ ByteBuf buffer = bbos.buffer();
+
+ try {
+ com.google.protobuf.Message message =
extractProtobufMessage(data, pbPacker);
Review Comment:
Just use Message?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]