From 76d233a4af85b1b25867b7777c3b74d25cd4a59a Mon Sep 17 00:00:00 2001 From: "minghua.xie" Date: Fri, 6 Dec 2024 11:06:37 +0800 Subject: [PATCH] v0 --- .../core/rpc/netty/MultiProtocolDecoder.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/apache/seata/core/rpc/netty/MultiProtocolDecoder.java b/core/src/main/java/org/apache/seata/core/rpc/netty/MultiProtocolDecoder.java index 9bd95503697..49db6b3db95 100644 --- a/core/src/main/java/org/apache/seata/core/rpc/netty/MultiProtocolDecoder.java +++ b/core/src/main/java/org/apache/seata/core/rpc/netty/MultiProtocolDecoder.java @@ -27,6 +27,8 @@ import org.apache.seata.core.rpc.netty.v0.ProtocolEncoderV0; import org.apache.seata.core.rpc.netty.v1.ProtocolDecoderV1; import org.apache.seata.core.rpc.netty.v1.ProtocolEncoderV1; +import org.apache.seata.core.rpc.netty.v2.ProtocolDecoderV2; +import org.apache.seata.core.rpc.netty.v2.ProtocolEncoderV2; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -83,12 +85,16 @@ int lengthFieldLength, FullLength is int(4B). so values is 4 int initialBytesToStrip we will check magic code and version self, so do not strip any bytes. so values is 0 */ super(maxFrameLength, 3, 4, -7, 0); - this.protocolDecoderMap = - ImmutableMap.builder().put(ProtocolConstants.VERSION_0, new ProtocolDecoderV0()) - .put(ProtocolConstants.VERSION_1, new ProtocolDecoderV1()).build(); - this.protocolEncoderMap = - ImmutableMap.builder().put(ProtocolConstants.VERSION_0, new ProtocolEncoderV0()) - .put(ProtocolConstants.VERSION_1, new ProtocolEncoderV1()).build(); + this.protocolDecoderMap = ImmutableMap.builder() + .put(ProtocolConstants.VERSION_0, new ProtocolDecoderV0()) + .put(ProtocolConstants.VERSION_1, new ProtocolDecoderV1()) + .put(ProtocolConstants.VERSION_2, new ProtocolDecoderV2()) + .build(); + this.protocolEncoderMap =ImmutableMap.builder() + .put(ProtocolConstants.VERSION_0, new ProtocolEncoderV0()) + .put(ProtocolConstants.VERSION_1, new ProtocolEncoderV1()) + .put(ProtocolConstants.VERSION_2, new ProtocolEncoderV2()) + .build(); this.channelHandlers = channelHandlers; }