Skip to content

Commit

Permalink
codec version
Browse files Browse the repository at this point in the history
  • Loading branch information
Bughue committed Nov 7, 2024
1 parent cbd0825 commit 6cfdf72
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.apache.seata.core.rpc;

import io.netty.channel.Channel;
import org.apache.seata.common.util.StringUtils;
import org.apache.seata.core.protocol.MessageType;
import org.apache.seata.core.protocol.MessageTypeAware;
import org.apache.seata.core.protocol.RpcMessage;
Expand All @@ -40,11 +41,14 @@ public static boolean versionNotSupport(Channel channel, RpcMessage rpcMessage){
}
Object msg = rpcMessage.getBody();
RpcContext rpcContext = ChannelManager.getContextFromIdentified(channel);
if (rpcContext == null || StringUtils.isBlank(rpcContext.getVersion()) || msg == null) {
return false;
}
boolean aboveV0 = Version.isAboveOrEqualVersion071(rpcContext.getVersion());
if(msg!=null && !aboveV0 && msg instanceof MessageTypeAware){
short typeCode = ((MessageTypeAware) msg).getTypeCode();
return SKIP_MSG_CODE_V0.contains(typeCode);
if(aboveV0 || !(msg instanceof MessageTypeAware)){
return false;
}
return false;
short typeCode = ((MessageTypeAware) msg).getTypeCode();
return SKIP_MSG_CODE_V0.contains(typeCode);
}
}

0 comments on commit 6cfdf72

Please sign in to comment.