Skip to content

Commit 0d1d85e

Browse files
author
Li2CO3
authored
docs: update docs about default thrift protocol from buffered to framed (#1422)
1 parent e2e3b51 commit 0d1d85e

4 files changed

Lines changed: 24 additions & 10 deletions

File tree

content/en/blog/releases/Kitex/release-v0_13_0.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,17 @@ description: >
4242

4343
User documentation: [StreamX Timeout Control](/docs/kitex/tutorials/basic-feature/streamx/streamx_timeout_control/)
4444

45-
2. **Default Thrift transport protocol changed from Buffered to Framed**
4645

47-
This change can leverage FastCodec for better performance.
46+
### **Special Change**
47+
48+
1. **Default Thrift transport protocol changed from Buffered to Framed**
49+
50+
This change leverages FastCodec for higher codec performance. Since Kitex server supports protocol detection, this behavioral change is compatible. Framed protocol is generally supported by most thrift frameworks, and we assess the impact to be minimal. However, if the downstream does not support Framed protocol, please manually revert to the Buffered protocol as follows:
51+
52+
```go
53+
cli := xxx.NewClient("service_name", client.WithTransportProtocol(transport.PurePayload))
54+
```
55+
4856

4957
### **Others**
5058
1. **Code Product Simplification**

content/en/docs/kitex/Tutorials/basic-feature/protocol/transport_protocol.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ If you want to use custom implementations for the message or transport protocol,
3434

3535
#### Thrift
3636

37-
1. Buffered: PurePayload (by default)
38-
2. configure Framed: prepend a 4-byte (int32) length before the Thrift pure payload
37+
1. Framed : prepend a 4-byte (int32) length before the Thrift pure payload. Kitex client uses Framed by default since v0.13.0, before v0.13.0, it used to be Buffered PurePayload.
38+
2. configure Buffered:add the below client option to set only send PurePayload
3939

4040
```go
41-
cli := xxx.NewClient("service_name", client.WithTransportProtocol(transport.Framed))
41+
cli := xxx.NewClient("service_name", client.WithTransportProtocol(transport.PurePayload))
4242
```
4343

4444
3. configure TTHeader: the protocol for Byted Mesh (Service Mesh 协议 )

content/zh/blog/releases/Kitex/release-v0_13_0.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@ description: >
4242

4343
详见 [StreamX 流超时控制](/zh/docs/kitex/tutorials/basic-feature/streamx/streamx_timeout_control/)
4444

45-
2. **Thrift 默认传输协议由 Buffered 改为 Framed**
45+
### **特殊变更**
4646

47-
这个变更可以利用 FastCodec 以获得更高的编解码性能。
47+
1. **Thrift 默认传输协议由 Buffered 改为 Framed**
48+
49+
这个变更可以利用 FastCodec 以获得更高的编解码性能。因为 Kitex 服务端支持协议探测,此行为变更是兼容的,通常支持 Apache Thrift 的框架都支持 Framed,我们评估影响不大,但如果你访问的下游不支持协议探测,或不支持 Framed,请手动参考下面的方式改回 Buffered 协议:
50+
51+
```go
52+
cli := xxx.NewClient("service_name", client.WithTransportProtocol(transport.PurePayload))
53+
```
4854

4955
### **其他**
5056
1. 产物简化

content/zh/docs/kitex/Tutorials/basic-feature/protocol/transport_protocol.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ Kitex 目前支持两种传输协议:[TTHeader](/zh/docs/kitex/reference/trans
3333

3434
#### Thrift
3535

36-
1. 默认 Buffered:PurePayload
37-
2. 指定 Framed:PurePayload 前增加 4 个字节(int32)指定 Payload Size
36+
1. 默认 Framed 协议:在 PurePayload 前增加 4 个字节(int32)指定 Payload Size。Kitex 在 v0.13.0 及以后默认使用 Framed 协议,之前版本默认使用 Buffered PurePayload。
37+
2. 指定 Buffered:按下面的方式设置 option,手动设置为只发送 PurePayload
3838

3939
```go
40-
cli := xxx.NewClient("service_name", client.WithTransportProtocol(transport.Framed))
40+
cli := xxx.NewClient("service_name", client.WithTransportProtocol(transport.PurePayload))
4141
```
4242

4343
3. 指定 TTHeader:

0 commit comments

Comments
 (0)