This is an automated email from the ASF dual-hosted git repository.

jianbin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new e4d61909d8 feature: add protobuf serialization support for 
UnregisterRM protocol (#8044)
e4d61909d8 is described below

commit e4d61909d8c921b39392a3c866c6df3639d70f09
Author: Eric Wang <[email protected]>
AuthorDate: Wed Apr 8 09:16:40 2026 +0800

    feature: add protobuf serialization support for UnregisterRM protocol 
(#8044)
---
 changes/en-us/2.x.md                               |  1 +
 changes/zh-cn/2.x.md                               |  1 +
 .../convertor/RegisterRMResponseConvertor.java     | 18 +++---
 .../convertor/UnregisterRMRequestConvertor.java    | 64 ++++++++++++++++++++++
 ...tor.java => UnregisterRMResponseConvertor.java} | 53 +++++++++---------
 .../protobuf/manager/ProtobufConvertManager.java   | 18 ++++++
 .../seata/protocol/transcation/messageType.proto   |  8 +++
 .../protocol/transcation/unregisterRMRequest.proto | 31 +++++++++++
 .../transcation/unregisterRMResponse.proto         | 29 ++++++++++
 .../UnregisterRMRequestConvertorTest.java          | 47 ++++++++++++++++
 .../UnregisterRMResponseConvertorTest.java         | 48 ++++++++++++++++
 11 files changed, 282 insertions(+), 36 deletions(-)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 69dd592d22..26a56c91e8 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -28,6 +28,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7903](https://github.com/apache/incubator-seata/pull/7903)] Support 
HTTP/2 stream push for the Watch API in Server Raft mode
 - [[#8002](https://github.com/apache/incubator-seata/pull/8002)] add Grafana 
dashboard JSON for NamingServer metrics
 - [[#8020](https://github.com/apache/incubator-seata/pull/8020)] add 
UnregisterRM protocol to notify server on client destroy
+- [[#8044](https://github.com/apache/incubator-seata/pull/8044)] add protobuf 
serialization support for UnregisterRM protocol
 
 ### bugfix:
 
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 684efa04d7..0b1e3de05d 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -29,6 +29,7 @@
 - [[#8014](https://github.com/apache/incubator-seata/pull/8014)] 为 benchmark 
CLI 添加 P99.9 尾延迟百分位
 - [[#8002](https://github.com/apache/incubator-seata/pull/8002)] 
为namingserver指标增加Grafana dashboard JSON
 - [[#8020](https://github.com/apache/incubator-seata/pull/8020)] 新增 
UnregisterRM 协议,在客户端销毁时通知服务端
+- [[#8044](https://github.com/apache/incubator-seata/pull/8044)] 为 
UnregisterRM 协议添加 protobuf 序列化支持
 
 ### bugfix:
 
diff --git 
a/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/RegisterRMResponseConvertor.java
 
b/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/RegisterRMResponseConvertor.java
index 505f7f2de9..aff116b350 100644
--- 
a/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/RegisterRMResponseConvertor.java
+++ 
b/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/RegisterRMResponseConvertor.java
@@ -69,21 +69,21 @@ public class RegisterRMResponseConvertor implements 
PbConvertor<RegisterRMRespon
 
     @Override
     public RegisterRMResponse convert2Model(RegisterRMResponseProto 
registerRMResponseProto) {
-        RegisterRMResponse registerRMRequest = new RegisterRMResponse();
+        RegisterRMResponse registerRMResponse = new RegisterRMResponse();
 
-        AbstractIdentifyResponseProto abstractIdentifyRequestProto =
+        AbstractIdentifyResponseProto abstractIdentifyResponseProto =
                 registerRMResponseProto.getAbstractIdentifyResponse();
-        
registerRMRequest.setExtraData(abstractIdentifyRequestProto.getExtraData());
-        
registerRMRequest.setVersion(abstractIdentifyRequestProto.getVersion());
-        
registerRMRequest.setIdentified(abstractIdentifyRequestProto.getIdentified());
+        
registerRMResponse.setExtraData(abstractIdentifyResponseProto.getExtraData());
+        
registerRMResponse.setVersion(abstractIdentifyResponseProto.getVersion());
+        
registerRMResponse.setIdentified(abstractIdentifyResponseProto.getIdentified());
 
-        registerRMRequest.setMsg(
-                
abstractIdentifyRequestProto.getAbstractResultMessage().getMsg());
-        
registerRMRequest.setResultCode(ResultCode.valueOf(abstractIdentifyRequestProto
+        registerRMResponse.setMsg(
+                
abstractIdentifyResponseProto.getAbstractResultMessage().getMsg());
+        
registerRMResponse.setResultCode(ResultCode.valueOf(abstractIdentifyResponseProto
                 .getAbstractResultMessage()
                 .getResultCode()
                 .name()));
 
-        return registerRMRequest;
+        return registerRMResponse;
     }
 }
diff --git 
a/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMRequestConvertor.java
 
b/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMRequestConvertor.java
new file mode 100644
index 0000000000..8c841d3377
--- /dev/null
+++ 
b/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMRequestConvertor.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.seata.serializer.protobuf.convertor;
+
+import org.apache.seata.core.protocol.UnregisterRMRequest;
+import 
org.apache.seata.serializer.protobuf.generated.AbstractIdentifyRequestProto;
+import org.apache.seata.serializer.protobuf.generated.AbstractMessageProto;
+import org.apache.seata.serializer.protobuf.generated.MessageTypeProto;
+import org.apache.seata.serializer.protobuf.generated.UnregisterRMRequestProto;
+
+public class UnregisterRMRequestConvertor implements 
PbConvertor<UnregisterRMRequest, UnregisterRMRequestProto> {
+    @Override
+    public UnregisterRMRequestProto convert2Proto(UnregisterRMRequest 
unregisterRMRequest) {
+        final short typeCode = unregisterRMRequest.getTypeCode();
+
+        final AbstractMessageProto abstractMessage = 
AbstractMessageProto.newBuilder()
+                .setMessageType(MessageTypeProto.forNumber(typeCode))
+                .build();
+
+        final String extraData = unregisterRMRequest.getExtraData();
+        AbstractIdentifyRequestProto abstractIdentifyRequestProto = 
AbstractIdentifyRequestProto.newBuilder()
+                .setAbstractMessage(abstractMessage)
+                .setApplicationId(unregisterRMRequest.getApplicationId())
+                .setExtraData(extraData == null ? "" : extraData)
+                
.setTransactionServiceGroup(unregisterRMRequest.getTransactionServiceGroup())
+                .setVersion(unregisterRMRequest.getVersion())
+                .build();
+        UnregisterRMRequestProto result = UnregisterRMRequestProto.newBuilder()
+                .setAbstractIdentifyRequest(abstractIdentifyRequestProto)
+                .setResourceIds(
+                        unregisterRMRequest.getResourceIds() == null ? "" : 
unregisterRMRequest.getResourceIds())
+                .build();
+
+        return result;
+    }
+
+    @Override
+    public UnregisterRMRequest convert2Model(UnregisterRMRequestProto 
unregisterRMRequestProto) {
+        UnregisterRMRequest unregisterRMRequest = new UnregisterRMRequest();
+
+        AbstractIdentifyRequestProto abstractIdentifyRequest = 
unregisterRMRequestProto.getAbstractIdentifyRequest();
+        
unregisterRMRequest.setResourceIds(unregisterRMRequestProto.getResourceIds());
+        
unregisterRMRequest.setApplicationId(abstractIdentifyRequest.getApplicationId());
+        
unregisterRMRequest.setExtraData(abstractIdentifyRequest.getExtraData());
+        
unregisterRMRequest.setTransactionServiceGroup(abstractIdentifyRequest.getTransactionServiceGroup());
+        unregisterRMRequest.setVersion(abstractIdentifyRequest.getVersion());
+
+        return unregisterRMRequest;
+    }
+}
diff --git 
a/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/RegisterRMResponseConvertor.java
 
b/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMResponseConvertor.java
similarity index 55%
copy from 
serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/RegisterRMResponseConvertor.java
copy to 
serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMResponseConvertor.java
index 505f7f2de9..7967cdec61 100644
--- 
a/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/RegisterRMResponseConvertor.java
+++ 
b/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMResponseConvertor.java
@@ -16,51 +16,50 @@
  */
 package org.apache.seata.serializer.protobuf.convertor;
 
-import org.apache.seata.core.protocol.RegisterRMResponse;
 import org.apache.seata.core.protocol.ResultCode;
+import org.apache.seata.core.protocol.UnregisterRMResponse;
 import 
org.apache.seata.serializer.protobuf.generated.AbstractIdentifyResponseProto;
 import org.apache.seata.serializer.protobuf.generated.AbstractMessageProto;
 import 
org.apache.seata.serializer.protobuf.generated.AbstractResultMessageProto;
 import org.apache.seata.serializer.protobuf.generated.MessageTypeProto;
-import org.apache.seata.serializer.protobuf.generated.RegisterRMResponseProto;
 import org.apache.seata.serializer.protobuf.generated.ResultCodeProto;
+import 
org.apache.seata.serializer.protobuf.generated.UnregisterRMResponseProto;
 
-public class RegisterRMResponseConvertor implements 
PbConvertor<RegisterRMResponse, RegisterRMResponseProto> {
+public class UnregisterRMResponseConvertor implements 
PbConvertor<UnregisterRMResponse, UnregisterRMResponseProto> {
     @Override
-    public RegisterRMResponseProto convert2Proto(RegisterRMResponse 
registerRMResponse) {
-        final short typeCode = registerRMResponse.getTypeCode();
+    public UnregisterRMResponseProto convert2Proto(UnregisterRMResponse 
unregisterRMResponse) {
+        final short typeCode = unregisterRMResponse.getTypeCode();
 
         final AbstractMessageProto abstractMessage = 
AbstractMessageProto.newBuilder()
                 .setMessageType(MessageTypeProto.forNumber(typeCode))
                 .build();
 
-        final String msg = registerRMResponse.getMsg();
+        final String msg = unregisterRMResponse.getMsg();
 
-        // for code
-        if (registerRMResponse.getResultCode() == null) {
-            if (registerRMResponse.isIdentified()) {
-                registerRMResponse.setResultCode(ResultCode.Success);
+        if (unregisterRMResponse.getResultCode() == null) {
+            if (unregisterRMResponse.isIdentified()) {
+                unregisterRMResponse.setResultCode(ResultCode.Success);
             } else {
-                registerRMResponse.setResultCode(ResultCode.Failed);
+                unregisterRMResponse.setResultCode(ResultCode.Failed);
             }
         }
 
         final AbstractResultMessageProto abstractResultMessageProto = 
AbstractResultMessageProto.newBuilder()
                 .setMsg(msg == null ? "" : msg)
                 .setResultCode(ResultCodeProto.valueOf(
-                        registerRMResponse.getResultCode().name()))
+                        unregisterRMResponse.getResultCode().name()))
                 .setAbstractMessage(abstractMessage)
                 .build();
 
-        final String extraData = registerRMResponse.getExtraData();
+        final String extraData = unregisterRMResponse.getExtraData();
         AbstractIdentifyResponseProto abstractIdentifyResponseProto = 
AbstractIdentifyResponseProto.newBuilder()
                 .setAbstractResultMessage(abstractResultMessageProto)
                 .setExtraData(extraData == null ? "" : extraData)
-                .setVersion(registerRMResponse.getVersion())
-                .setIdentified(registerRMResponse.isIdentified())
+                .setVersion(unregisterRMResponse.getVersion())
+                .setIdentified(unregisterRMResponse.isIdentified())
                 .build();
 
-        RegisterRMResponseProto result = RegisterRMResponseProto.newBuilder()
+        UnregisterRMResponseProto result = 
UnregisterRMResponseProto.newBuilder()
                 .setAbstractIdentifyResponse(abstractIdentifyResponseProto)
                 .build();
 
@@ -68,22 +67,22 @@ public class RegisterRMResponseConvertor implements 
PbConvertor<RegisterRMRespon
     }
 
     @Override
-    public RegisterRMResponse convert2Model(RegisterRMResponseProto 
registerRMResponseProto) {
-        RegisterRMResponse registerRMRequest = new RegisterRMResponse();
+    public UnregisterRMResponse convert2Model(UnregisterRMResponseProto 
unregisterRMResponseProto) {
+        UnregisterRMResponse unregisterRMResponse = new UnregisterRMResponse();
 
-        AbstractIdentifyResponseProto abstractIdentifyRequestProto =
-                registerRMResponseProto.getAbstractIdentifyResponse();
-        
registerRMRequest.setExtraData(abstractIdentifyRequestProto.getExtraData());
-        
registerRMRequest.setVersion(abstractIdentifyRequestProto.getVersion());
-        
registerRMRequest.setIdentified(abstractIdentifyRequestProto.getIdentified());
+        AbstractIdentifyResponseProto abstractIdentifyResponseProto =
+                unregisterRMResponseProto.getAbstractIdentifyResponse();
+        
unregisterRMResponse.setExtraData(abstractIdentifyResponseProto.getExtraData());
+        
unregisterRMResponse.setVersion(abstractIdentifyResponseProto.getVersion());
+        
unregisterRMResponse.setIdentified(abstractIdentifyResponseProto.getIdentified());
 
-        registerRMRequest.setMsg(
-                
abstractIdentifyRequestProto.getAbstractResultMessage().getMsg());
-        
registerRMRequest.setResultCode(ResultCode.valueOf(abstractIdentifyRequestProto
+        unregisterRMResponse.setMsg(
+                
abstractIdentifyResponseProto.getAbstractResultMessage().getMsg());
+        
unregisterRMResponse.setResultCode(ResultCode.valueOf(abstractIdentifyResponseProto
                 .getAbstractResultMessage()
                 .getResultCode()
                 .name()));
 
-        return registerRMRequest;
+        return unregisterRMResponse;
     }
 }
diff --git 
a/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/manager/ProtobufConvertManager.java
 
b/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/manager/ProtobufConvertManager.java
index 4d59fba3f0..e2663e4677 100644
--- 
a/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/manager/ProtobufConvertManager.java
+++ 
b/serializer/seata-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/manager/ProtobufConvertManager.java
@@ -24,6 +24,8 @@ import org.apache.seata.core.protocol.RegisterRMRequest;
 import org.apache.seata.core.protocol.RegisterRMResponse;
 import org.apache.seata.core.protocol.RegisterTMRequest;
 import org.apache.seata.core.protocol.RegisterTMResponse;
+import org.apache.seata.core.protocol.UnregisterRMRequest;
+import org.apache.seata.core.protocol.UnregisterRMResponse;
 import org.apache.seata.core.protocol.transaction.BranchCommitRequest;
 import org.apache.seata.core.protocol.transaction.BranchCommitResponse;
 import org.apache.seata.core.protocol.transaction.BranchRegisterRequest;
@@ -75,6 +77,8 @@ import 
org.apache.seata.serializer.protobuf.convertor.RegisterRMResponseConverto
 import 
org.apache.seata.serializer.protobuf.convertor.RegisterTMRequestConvertor;
 import 
org.apache.seata.serializer.protobuf.convertor.RegisterTMResponseConvertor;
 import 
org.apache.seata.serializer.protobuf.convertor.UndoLogDeleteRequestConvertor;
+import 
org.apache.seata.serializer.protobuf.convertor.UnregisterRMRequestConvertor;
+import 
org.apache.seata.serializer.protobuf.convertor.UnregisterRMResponseConvertor;
 import org.apache.seata.serializer.protobuf.generated.BatchResultMessageProto;
 import org.apache.seata.serializer.protobuf.generated.BranchCommitRequestProto;
 import 
org.apache.seata.serializer.protobuf.generated.BranchCommitResponseProto;
@@ -104,6 +108,8 @@ import 
org.apache.seata.serializer.protobuf.generated.RegisterRMResponseProto;
 import org.apache.seata.serializer.protobuf.generated.RegisterTMRequestProto;
 import org.apache.seata.serializer.protobuf.generated.RegisterTMResponseProto;
 import 
org.apache.seata.serializer.protobuf.generated.UndoLogDeleteRequestProto;
+import org.apache.seata.serializer.protobuf.generated.UnregisterRMRequestProto;
+import 
org.apache.seata.serializer.protobuf.generated.UnregisterRMResponseProto;
 
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -173,6 +179,10 @@ public class ProtobufConvertManager {
                     RegisterRMRequest.class.getName(), new 
RegisterRMRequestConvertor());
             protobufConvertManager.convertorMap.put(
                     RegisterRMResponse.class.getName(), new 
RegisterRMResponseConvertor());
+            protobufConvertManager.convertorMap.put(
+                    UnregisterRMRequest.class.getName(), new 
UnregisterRMRequestConvertor());
+            protobufConvertManager.convertorMap.put(
+                    UnregisterRMResponse.class.getName(), new 
UnregisterRMResponseConvertor());
             protobufConvertManager.convertorMap.put(
                     RegisterTMRequest.class.getName(), new 
RegisterTMRequestConvertor());
             protobufConvertManager.convertorMap.put(
@@ -233,6 +243,10 @@ public class ProtobufConvertManager {
                     RegisterRMRequestProto.getDescriptor().getFullName(), 
RegisterRMRequestProto.class);
             protobufConvertManager.protoClazzMap.put(
                     RegisterRMResponseProto.getDescriptor().getFullName(), 
RegisterRMResponseProto.class);
+            protobufConvertManager.protoClazzMap.put(
+                    UnregisterRMRequestProto.getDescriptor().getFullName(), 
UnregisterRMRequestProto.class);
+            protobufConvertManager.protoClazzMap.put(
+                    UnregisterRMResponseProto.getDescriptor().getFullName(), 
UnregisterRMResponseProto.class);
             protobufConvertManager.protoClazzMap.put(
                     RegisterTMRequestProto.getDescriptor().getFullName(), 
RegisterTMRequestProto.class);
             protobufConvertManager.protoClazzMap.put(
@@ -293,6 +307,10 @@ public class ProtobufConvertManager {
                     RegisterRMRequestProto.class.getName(), new 
RegisterRMRequestConvertor());
             protobufConvertManager.reverseConvertorMap.put(
                     RegisterRMResponseProto.class.getName(), new 
RegisterRMResponseConvertor());
+            protobufConvertManager.reverseConvertorMap.put(
+                    UnregisterRMRequestProto.class.getName(), new 
UnregisterRMRequestConvertor());
+            protobufConvertManager.reverseConvertorMap.put(
+                    UnregisterRMResponseProto.class.getName(), new 
UnregisterRMResponseConvertor());
             protobufConvertManager.reverseConvertorMap.put(
                     RegisterTMRequestProto.class.getName(), new 
RegisterTMRequestConvertor());
             protobufConvertManager.reverseConvertorMap.put(
diff --git 
a/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/messageType.proto
 
b/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/messageType.proto
index 754ce1173c..7aa176f9ab 100644
--- 
a/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/messageType.proto
+++ 
b/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/messageType.proto
@@ -129,6 +129,14 @@ enum MessageTypeProto {
      * The constant TYPE_REG_RM_RESULT.
      */
     TYPE_REG_RM_RESULT = 104;
+    /**
+     * The constant TYPE_UNREG_RM.
+     */
+    TYPE_UNREG_RM = 105;
+    /**
+     * The constant TYPE_UNREG_RM_RESULT.
+     */
+    TYPE_UNREG_RM_RESULT = 106;
 
     /**
      * The constant TYPE_UNDO_LOG_DELETE.
diff --git 
a/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/unregisterRMRequest.proto
 
b/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/unregisterRMRequest.proto
new file mode 100644
index 0000000000..fe808adef3
--- /dev/null
+++ 
b/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/unregisterRMRequest.proto
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto3";
+
+package org.apache.seata.protocol.protobuf;
+
+import "abstractIdentifyRequest.proto";
+
+option java_multiple_files = true;
+option java_outer_classname = "UnregisterRMRequest";
+option java_package = "org.apache.seata.serializer.protobuf.generated";
+
+message UnregisterRMRequestProto {
+    AbstractIdentifyRequestProto abstractIdentifyRequest = 1;
+    string resourceIds = 2;
+
+}
diff --git 
a/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/unregisterRMResponse.proto
 
b/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/unregisterRMResponse.proto
new file mode 100644
index 0000000000..b313cbbed2
--- /dev/null
+++ 
b/serializer/seata-serializer-protobuf/src/main/resources/protobuf/org/apache/seata/protocol/transcation/unregisterRMResponse.proto
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto3";
+
+package org.apache.seata.protocol.protobuf;
+
+import "abstractIdentifyResponse.proto";
+
+option java_multiple_files = true;
+option java_outer_classname = "UnregisterRMResponse";
+option java_package = "org.apache.seata.serializer.protobuf.generated";
+
+message UnregisterRMResponseProto {
+    AbstractIdentifyResponseProto abstractIdentifyResponse = 1;
+}
diff --git 
a/serializer/seata-serializer-protobuf/src/test/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMRequestConvertorTest.java
 
b/serializer/seata-serializer-protobuf/src/test/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMRequestConvertorTest.java
new file mode 100644
index 0000000000..89ce94387b
--- /dev/null
+++ 
b/serializer/seata-serializer-protobuf/src/test/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMRequestConvertorTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.seata.serializer.protobuf.convertor;
+
+import org.apache.seata.core.protocol.UnregisterRMRequest;
+import org.apache.seata.serializer.protobuf.generated.UnregisterRMRequestProto;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class UnregisterRMRequestConvertorTest {
+
+    @Test
+    public void convert2ProtoTest() {
+        UnregisterRMRequest unregisterRMRequest = new UnregisterRMRequest();
+        unregisterRMRequest.setResourceIds("res1");
+        unregisterRMRequest.setVersion("123");
+        unregisterRMRequest.setTransactionServiceGroup("group");
+        unregisterRMRequest.setExtraData("extraData");
+        unregisterRMRequest.setApplicationId("appId");
+
+        UnregisterRMRequestConvertor convertor = new 
UnregisterRMRequestConvertor();
+        UnregisterRMRequestProto proto = 
convertor.convert2Proto(unregisterRMRequest);
+        UnregisterRMRequest real = convertor.convert2Model(proto);
+
+        
assertThat((real.getTypeCode())).isEqualTo(unregisterRMRequest.getTypeCode());
+        
assertThat((real.getResourceIds())).isEqualTo(unregisterRMRequest.getResourceIds());
+        
assertThat((real.getVersion())).isEqualTo(unregisterRMRequest.getVersion());
+        
assertThat((real.getTransactionServiceGroup())).isEqualTo(unregisterRMRequest.getTransactionServiceGroup());
+        
assertThat((real.getExtraData())).isEqualTo(unregisterRMRequest.getExtraData());
+        
assertThat((real.getApplicationId())).isEqualTo(unregisterRMRequest.getApplicationId());
+    }
+}
diff --git 
a/serializer/seata-serializer-protobuf/src/test/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMResponseConvertorTest.java
 
b/serializer/seata-serializer-protobuf/src/test/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMResponseConvertorTest.java
new file mode 100644
index 0000000000..ff6d316f32
--- /dev/null
+++ 
b/serializer/seata-serializer-protobuf/src/test/java/org/apache/seata/serializer/protobuf/convertor/UnregisterRMResponseConvertorTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.seata.serializer.protobuf.convertor;
+
+import org.apache.seata.core.protocol.ResultCode;
+import org.apache.seata.core.protocol.UnregisterRMResponse;
+import 
org.apache.seata.serializer.protobuf.generated.UnregisterRMResponseProto;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class UnregisterRMResponseConvertorTest {
+
+    @Test
+    public void convert2ProtoTest() {
+        UnregisterRMResponse unregisterRMResponse = new UnregisterRMResponse();
+        unregisterRMResponse.setResultCode(ResultCode.Failed);
+        unregisterRMResponse.setMsg("msg");
+        unregisterRMResponse.setIdentified(true);
+        unregisterRMResponse.setVersion("11");
+        unregisterRMResponse.setExtraData("extraData");
+
+        UnregisterRMResponseConvertor convertor = new 
UnregisterRMResponseConvertor();
+        UnregisterRMResponseProto proto = 
convertor.convert2Proto(unregisterRMResponse);
+        UnregisterRMResponse real = convertor.convert2Model(proto);
+
+        
assertThat((real.getTypeCode())).isEqualTo(unregisterRMResponse.getTypeCode());
+        assertThat((real.getMsg())).isEqualTo(unregisterRMResponse.getMsg());
+        
assertThat((real.getResultCode())).isEqualTo(unregisterRMResponse.getResultCode());
+        
assertThat((real.isIdentified())).isEqualTo(unregisterRMResponse.isIdentified());
+        
assertThat((real.getVersion())).isEqualTo(unregisterRMResponse.getVersion());
+        
assertThat((real.getExtraData())).isEqualTo(unregisterRMResponse.getExtraData());
+    }
+}


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

Reply via email to