You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "wxrqforever (via GitHub)" <gi...@apache.org> on 2025/04/14 08:52:46 UTC
[I] 关于seata使用的协议能够支持的最大消息体问题咨询 [incubator-seata]
wxrqforever opened a new issue, #7296:
URL: https://github.com/apache/incubator-seata/issues/7296
一、背景介绍
您好,在使用tcc模式,在prepare方法里会使用@BusinessActionContextParameter传递业务方法参数如代码中的bizData,在我们的场景下这个bizData可能很大,这个参数信息会随着tcc 分支上报到服务端,所以想了解下seata 协议能够设计能够传输的上限
```
public boolean prepare(BusinessActionContext actionContext, @BusinessActionContextParameter(paramName = "bizData" Object bizData) ) {
//省略
return true;
}
```
我看了一下相关的编码和解码类,在org.apache.seata.core.rpc.netty.v1.ProtocolV1Encoder中我发现Full length定义的长度是4个字节,所以理论全部长度是4GB,
<img width="953" alt="Image" src="https://github.com/user-attachments/assets/fbdb8ee1-e115-47d1-b9ee-eedc9de8f571" />
但是在解码器中org.apache.seata.core.rpc.netty.v1.ProtocolV1Decoder,却限制了整个桢的大小为8M,
<img width="634" alt="Image" src="https://github.com/user-attachments/assets/a96c786f-ad40-433b-a954-4045b3102d89" />
基于上面我想确认下,所以通过在tcc中传递的消息的长度理论上来说应该是小于8M对吗(不考虑头部长度)?如果是的话想了解下为啥编码和解码在长度上的设计不是统一的,是出于什么考虑的,这种限制有办法配置修改吗?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] 关于seata使用的协议能够支持的最大消息体问题咨询 [incubator-seata]
Posted by "Bughue (via GitHub)" <gi...@apache.org>.
Bughue commented on issue #7296:
URL: https://github.com/apache/incubator-seata/issues/7296#issuecomment-2999276771
hello,协议传输大小确实是限制了8M的,这是因为交互过程中的数据包如果太大是很影响seata性能的。对于fullLength的长度,可以认为我们要在1/2/3/4里选合适的值,它的作用并不是在直接限制length大小,而是对长度字段的完整传输和解析,侧重对协议扩展性的总和考量。
另外如果你的bizData很大,我们建议这些数据是要保存进你的持久化存储中,而不是每个步骤都带着完整的数据来回的,这有可能使得seata成为你们的性能瓶颈。
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org