rockXiaofeng commented on pull request #1087:
URL: https://github.com/apache/dubbo-go/pull/1087#issuecomment-802610442


   FYI (from com.alibaba/dubbo) : 
   ```
   public class DecodeableRpcInvocation extends RpcInvocation implements Codec, 
Decodeable {
   ...
   @Override
       public Object decode(Channel channel, InputStream input) throws 
IOException {
           ObjectInput in = CodecSupport.getSerialization(channel.getUrl(), 
serializationType)
                   .deserialize(channel.getUrl(), input);
    
           String dubboVersion = in.readUTF();
           request.setVersion(dubboVersion);
           setAttachment(Constants.DUBBO_VERSION_KEY, dubboVersion);
    
           setAttachment(Constants.PATH_KEY, in.readUTF());
           setAttachment(Constants.VERSION_KEY, in.readUTF());
    ...
     Map<string, string=""> map = (Map<string, string="">) 
in.readObject(Map.class);
               if (map != null && map.size() > 0) {
                   Map<string, string=""> attachment = getAttachments();
                   if (attachment == null) {
                       attachment = new HashMap<string, string="">();
                   }
                   attachment.putAll(map);
                   setAttachments(attachment);
               }
               //decode argument ,may be callback
               for (int i = 0; i < args.length; i++) {
                   args[i] = decodeInvocationArgument(channel, this, pts, i, 
args[i]);
               }
    
               setArguments(args);
    
   ```


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to