You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by ji...@apache.org on 2024/11/10 04:29:35 UTC
(incubator-seata) branch 2.x updated: optimize: gRPC serialization default to Protobuf (#6991)
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 835ef47448 optimize: gRPC serialization default to Protobuf (#6991)
835ef47448 is described below
commit 835ef47448c1c0819552297bd3c45d61125edcd5
Author: funkye <ji...@apache.org>
AuthorDate: Sun Nov 10 12:29:30 2024 +0800
optimize: gRPC serialization default to Protobuf (#6991)
---
changes/en-us/2.x.md | 1 +
changes/zh-cn/2.x.md | 1 +
.../main/java/org/apache/seata/core/rpc/netty/grpc/GrpcDecoder.java | 3 ++-
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 5e7938a198..8ba5550332 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -41,6 +41,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6938](https://github.com/apache/incubator-seata/pull/6938)] Update online chat information in README.md
- [[#6950](https://github.com/apache/incubator-seata/pull/6950)] Remove JVM parameter app.id
- [[#6959](https://github.com/apache/incubator-seata/pull/6959)] update the naming and description for the `seata-http-jakarta` module
+- [[#6991](https://github.com/apache/incubator-seata/pull/6991)] gRPC serialization default to Protobuf
### refactor:
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 87e3c059ab..915a039cbb 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -43,6 +43,7 @@
- [[#6938](https://github.com/apache/incubator-seata/pull/6938)] 更新 README.md 中的社区联系信息
- [[#6950](https://github.com/apache/incubator-seata/pull/6950)] 移除JVM参数app.id
- [[#6959](https://github.com/apache/incubator-seata/pull/6959)] 修正 `seata-http-jakarta`的模块命名和描述
+- [[#6991](https://github.com/apache/incubator-seata/pull/6991)] gRPC协议序列化默认值为protobuf
### refactor:
diff --git a/core/src/main/java/org/apache/seata/core/rpc/netty/grpc/GrpcDecoder.java b/core/src/main/java/org/apache/seata/core/rpc/netty/grpc/GrpcDecoder.java
index 71c9caf8be..e227d5dc7c 100644
--- a/core/src/main/java/org/apache/seata/core/rpc/netty/grpc/GrpcDecoder.java
+++ b/core/src/main/java/org/apache/seata/core/rpc/netty/grpc/GrpcDecoder.java
@@ -94,7 +94,8 @@ public class GrpcDecoder extends ChannelDuplexHandler {
bodyBytes = compressor.decompress(bodyBytes);
}
String codecValue = headMap.get(GrpcHeaderEnum.CODEC_TYPE.header);
- int codec = Integer.parseInt(codecValue);
+ int codec = StringUtils.isBlank(codecValue) ? SerializerType.PROTOBUF.getCode()
+ : Integer.parseInt(codecValue);
SerializerType serializerType = SerializerType.getByCode(codec);
rpcMsg.setCodec(serializerType.getCode());
Serializer serializer = SerializerServiceLoader.load(serializerType);
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org