You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v0.12.0 released the StreamX interface to optimise the streaming experience, and supported the custom streaming protocol TTHeader Streaming, but did not support gRPC. So existing users could not migrate.
16
17
17
18
This version supports gRPC for StreamX, users can migrate to StreamX, and the Server side can be compatible with two streaming protocols at the same time. So there is no need to worry about protocol compatibility after interface migration.
@@ -20,7 +21,8 @@ description: >
20
21
21
22
User documentation: [StreamX User Documentation](/docs/kitex/tutorials/basic-feature/streamx)
[Prutal](https://github.com/cloudwego/prutal) is officially open source, on par with Thrift's [Frugal](https://github.com/cloudwego/frugal), and the new version of Kitex integrates Prutal by default.
25
27
26
28
Advantages:
@@ -34,59 +36,79 @@ description: >
34
36
User documentation: [Prutal](/docs/kitex/tutorials/code-gen/prutal)
35
37
36
38
### **Feature/Experience Optimization**
37
-
1.**TTHeader Streaming**: Support interface-level Recv timeout control
39
+
1.**TTHeader Streaming: Support interface-level Recv timeout control**
40
+
38
41
In addition to the existing Client level, this release of TTHeader Streaming supports interface-level Recv timeout configuration, making configuration more flexible.
39
42
40
-
User documentation: [StreamX Timeout Control](/docs/kitex/tutorials/basic-feature/streamx/timeout-control)
43
+
User documentation: [StreamX Timeout Control](/docs/kitex/tutorials/basic-feature/streamx/kitex+streamx+-+stream+timeout+control/)
44
+
45
+
2.**Default Thrift transport protocol changed from Buffered to Framed**
41
46
42
-
2. Default Thrift transport protocol changed from Buffered to Framed
43
47
This change can leverage FastCodec for better performance.
44
48
45
49
### **Others**
46
-
1. Code Product Simplification
47
-
- Kitex Tool would not generate the repeated verification code for Set data structure and the ```DeepEqual``` function for each structure by default.
50
+
1.**Code Product Simplification**
51
+
52
+
- Kitex Tool would not generate the repeated verification code for Set data structure and the ```DeepEqual``` function for each structure by default.
48
53
49
-
- If you only want to restore```DeepEqual```, add```-thrift gen_deep_equal=true```to the generation command.
54
+
- If you only want to restore```DeepEqual```, add```-thrift gen_deep_equal=true```to the generation command.
50
55
51
-
- If you want to restore the repeated verification of Set, add```-thrift validate_set=true, -thrift gen_deep_equal=true```to the generation command.
56
+
- If you want to restore the repeated verification of Set, add```-thrift validate_set=true, -thrift gen_deep_equal=true```to the generation command.
52
57
53
-
- Kitex Tool would not generate the Apache Codec related code by default.
58
+
- Kitex Tool would not generate the Apache Codec related code by default.
54
59
55
-
- If you want to restore it, add```-thrift no_default_serdes=false```to the generation command.
60
+
- If you want to restore it, add```-thrift no_default_serdes=false```to the generation command.
56
61
57
-
2. Go Supported Version Change
62
+
2.**Go Supported Version Change**
63
+
58
64
Support version Go 1.19~1.24, the lowest supported version becomes Go 1.19.
59
65
60
66
if Go version is too low, there will be a prompt when compiling:```note: module requires Go 1.19```.
61
67
62
68
## **Full Change**
63
69
### Feature
64
70
[[#1719](https://github.com/cloudwego/kitex/pull/1719)] feat: prutal for replacing protoc
71
+
65
72
[[#1736](https://github.com/cloudwego/kitex/pull/1736)] feat(ttstream): support WithRecvTimeout stream call option
73
+
66
74
[[#1702](https://github.com/cloudwego/kitex/pull/1702)] feat(gRPC): add grpc client conn dump to help debug the conn and stream status
75
+
67
76
[[#1723](https://github.com/cloudwego/kitex/pull/1723)] feat(codec/thrift): use fastcodec/frugal if apache codec not available
77
+
68
78
[[#1724](https://github.com/cloudwego/kitex/pull/1724)] feat: add tail option to support for delayed initialization of some client options
69
79
70
80
### Optimize
71
81
[[#1728](https://github.com/cloudwego/kitex/pull/1728)] optimize(apache): remove apache codec gen and set default protocol from buffered to framed
82
+
72
83
[[#1732](https://github.com/cloudwego/kitex/pull/1732)] optimize(rpcinfo): purify the transport protocol of rpcinfo in a single rpc request
84
+
73
85
[[#1711](https://github.com/cloudwego/kitex/pull/1711)] optimize(tool): disable set validate and deep equal code gen to simplify kitex_gen
86
+
74
87
[[#1717](https://github.com/cloudwego/kitex/pull/1717)] optimize(gRPC): return more detailed error when received invalid http2 frame
75
88
76
89
### Fix
77
90
[[#1734](https://github.com/cloudwego/kitex/pull/1734)] fix(ttstream): adjust stream state transition and remove all SetFinalizer to avoid memory leak
91
+
78
92
[[#1735](https://github.com/cloudwego/kitex/pull/1735)] fix(generic): support both relative and absolute check for idl includes parse to make it compatible with generation tool
93
+
79
94
[[#1725](https://github.com/cloudwego/kitex/pull/1725)] fix: code gen import issue for streamx mode, stream call judgement bug and set ttheader streaming as default
[[#1658](https://github.com/cloudwego/kitex/pull/1658)] refactor: streamx api to adapt both grpc and ttheader streaming protocol and provide more user-friendly interface
100
+
84
101
[[#1729](https://github.com/cloudwego/kitex/pull/1729)] refactor(tool): move pb tpl code to sep pkg
85
102
86
103
### Chore
87
104
[[#1743](https://github.com/cloudwego/kitex/pull/1743)] chore: update dependencies version
[[#1737](https://github.com/cloudwego/kitex/pull/1737)] chore: update dependency and change go support to 1.19-1.24
113
+
92
114
[[#1720](https://github.com/cloudwego/kitex/pull/1720)] Revert "fix(ttstream): pingpong method refers to server interface defined in Kitex generation code when streamx is enabled and there are other streaming methods"
Copy file name to clipboardExpand all lines: content/en/docs/kitex/Tutorials/basic-feature/streamx/Kitex+StreamX+-+Stream+Metainfo.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ description: ""
8
8
9
9
## Preface
10
10
11
-
The overall usage of message pass-through is similar to [Kitex - 元信息透传](https://bytedance.larkoffice.com/wiki/Y3ChwldJzihF4Vkb6Ekcie38no4), except that each stream can only **pass-through meta-information when created** , and sending messages cannot pass-through.
11
+
The overall usage of message pass-through is similar to [Metainfo](/docs/kitex/tutorials/advanced-feature/metainfo/), except that each stream can only **pass-through meta-information when created** , and sending messages cannot pass-through.
12
12
13
13
## User guide
14
14
@@ -37,7 +37,9 @@ func (s *streamingService) EchoClient(ctx context.Context,
37
37
38
38
### Server reverse pass-through meta-message
39
39
40
-
Reverse pass-through introduces a new concept, Header and Trailer. Any complete data stream must include Header and Trailer. Use these two frames to reverse pass-through information.
40
+
Reverse pass-through introduces a new concept, Header and Trailer. Any complete data stream must include Header and Trailer.
41
+
42
+
Use these two frames to reverse pass-through information.
41
43
42
44
```go
43
45
import"github.com/cloudwego/pkg/streaming"
@@ -75,6 +77,6 @@ tl, err := stream.Trailer()
75
77
76
78
Because the concept of flow is different from , under the flow, the Header can be sent independently, which means that my server can send the Header in the first second, send the Data after 10 seconds, and send the Trailer after 1 second.
77
79
78
-
At the same time, the client can also choose whether to call `.Header () ` or `.Trailer ()` to block.
80
+
At the same time, the client can also choose whether to call `.Header()` or `.Trailer ()` to block.
79
81
80
-
Therefore, the semantics of traditional CTX cannot meet the reverse pass-through function of streams. Forward pass-through is still consistent with the original.
82
+
Therefore, the semantics of traditional ctx cannot meet the reverse pass-through function of streams. Forward pass-through is still consistent with the original.
Copy file name to clipboardExpand all lines: content/en/docs/kitex/Tutorials/basic-feature/streamx/Kitex+StreamX+-+Stream+Middleware.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,9 @@ type StreamRecvMiddleware func(next StreamRecvEndpoint) StreamRecvEndpoint
60
60
61
61
### Unary Middlware
62
62
63
-
For all non-streaming interfaces, we additionally provide ```UnaryMiddleware``` for injecting middleware that only works on all unary methods, which is identical to the ```WithMiddleware``` natively supported by kitex, with the difference that the latter can also work on streaming methods.
63
+
For all non-streaming interfaces, we additionally provide ```UnaryMiddleware``` for injecting middleware that only works on all unary methods.
64
+
65
+
It is identical to the ```WithMiddleware``` natively supported by kitex, with the difference that the latter can also work on streaming methods.
64
66
```go
65
67
type UnaryEndpoint Endpoint
66
68
type UnaryMiddleware func(next UnaryEndpoint) UnaryEndpoint
Starting from v0.13.0, kitex will use its own prutal implementation to replace Protobuf's protoc and protoc-gen-go for code generation and serialisation.
11
10
12
-
kitex will no longer need to install protoc, protoc-gen-go. New users will not be aware of the change.
11
+
Starting from v0.13.0, Kitex will use its own Prutal implementation to replace Protobuf's protoc and protoc-gen-go for code generation and serialisation.
13
12
14
-
prutal is compatible with the existing protobuf in terms of serialisation, and generates code that is very compact, has no extra code, and has better serialisation performance than the official one.
13
+
Kitex will no longer need to install protoc, protoc-gen-go. New users will not be aware of the change.
15
14
16
-
Technically prutal and frugal similar to the use of struct tags and efficient reflection to achieve serialisation , and does not rely on redundant generation code.
15
+
Prutal is compatible with the existing Protobuf in terms of serialisation, and generates code that is very compact, has no extra code, and has better serialisation performance than the official one.
17
16
18
-
Currently open source, the specific implementation and subsequent benchmark data can be concerned: https://github.com/cloudwego/prutal
17
+
Technically Prutal and Frugal are similar to the use of struct tags and efficient reflection to achieve serialisation, and does not rely on redundant generation code.
18
+
19
+
Currently open source, the specific implementation and subsequent benchmark data can be viewed: https://github.com/cloudwego/prutal
19
20
20
21
## **Using Advices**
21
-
Initially, it is not recommended that users use prutal directly, and currently only promises forward and backward compatibility with prutal integration in kitex.
22
+
23
+
Initially, it is not recommended that users use Prutal directly, and currently only promises forward and backward compatibility with Prutal integration in Kitex.
24
+
25
+
If you find any problems while using Kitex, you can fallback to Protobuf using the environment variable KITEX_TOOL_USE_PROTOC
22
26
23
-
If you find any problems while using kitex, you can fallback to protobuf using the environment variable KITEX_TOOL_USE_PROTOC
27
+
```
28
+
KITEX_TOOL_USE_PROTOC=1 kitex --version
29
+
```
24
30
25
-
```KITEX_TOOL_USE_PROTOC=1 kitex --version```
31
+
In the future, Kitex will deprecate the protoc implementation.
26
32
27
-
In the long run, kitex will deprecate the protoc implementation. It is recommended that if you encounter problems with usage, you can provide feedback to help improve it.
33
+
It is recommended that if you encounter problems with usage, you can provide feedback to help improve it.
28
34
29
35
## **Kitex Tool Updates**
30
-
Since protoc is no longer used as the default code generation tool, the following arguments will be deprecated:
36
+
37
+
Since protoc is no longer used as the default code generation tool, the following arguments will be deprecated:
31
38
32
39
--protobuf
33
40
34
41
--protobuf-plugin
35
42
36
-
These two arguments are mainly used for passthrough to protoc, and are not actually used by kitex itself. If they are still specified, an error will be reported:
43
+
These two arguments are mainly used for passthrough to protoc, and are not actually used by Kitex itself. If they are still specified, an error will be reported:
37
44
38
-
```
39
-
[ERROR] invalid value ‘xxx’ for flag -protobuf: flag is deprecated
40
-
[ERROR] invalid value ‘xxx’ for flag -protobuf-plugin: flag is deprecated
41
-
```
45
+
```
46
+
[ERROR] invalid value ‘xxx’ for flag -protobuf: flag is deprecated
47
+
[ERROR] invalid value ‘xxx’ for flag -protobuf-plugin: flag is deprecated
48
+
```
42
49
43
-
Users can call protoc and related plugins for code generation if they want. Instead of relying on kitex to call protoc.
50
+
Users can call protoc and related plugins for code generation if they want. Instead of relying on Kitex to call protoc.
44
51
45
-
Due to the complexity of generating paths in older protoc implementations, the following arguments do not work in older implementations:
52
+
Due to the complexity of generating paths in older protoc implementations, the following arguments do not work in older implementations:
46
53
47
54
-gen-path
48
55
49
-
which defaults to kitex_gen, has been fixed in the new Prutal.
56
+
which defaults to kitex_gen, has been fixed in the new Prutal.
50
57
51
58
## **Prutal and Protobuf compatibility issues**
52
-
kitex uses prutal to generate code by default.
53
59
54
-
If the user does Marshal / Unmarshal directly from the protobuf library, the new kitex will generate code with a compile-time error:
60
+
Kitex uses Prutal to generate code by default.
55
61
56
-
```cannot use &YourRequest{} (value of type *YourRequest) as protoreflect.ProtoMessage value in argument to proto.Marshal: *YourRequest does not implement protoreflect.ProtoMessage (missing method ProtoReflect) ```
57
-
This is because the protobuf library is strongly bound to the protobuf generation code, and protobuf needs to generate a lot of binary data to assist its reflection implementation.
62
+
If the user does Marshal / Unmarshal directly from the protobuf library, the new Kitex will generate code with a compile-time error:
58
63
59
-
It is recommended to use the github.com/cloudwego/prutal package directly.
64
+
```
65
+
cannot use &YourRequest{} (value of type *YourRequest) as protoreflect.ProtoMessage value in argument to proto.Marshal: *YourRequest does not implement protoreflect.ProtoMessage (missing method ProtoReflect)
66
+
```
60
67
61
-
```
62
-
// MarshalAppend appends the protobuf encoding of v to b and returns the new bytes
63
-
func MarshalAppend(b []byte, v interface{}) ([]byte, error)
68
+
This is because the Protobuf library is strongly bound to the Protobuf generation code, and Protobuf needs to generate a lot of binary data to assist its reflection implementation.
64
69
65
-
// Unmarshal parses the protobuf-encoded data and stores the result in the value pointed to by v.
66
-
func Unmarshal(b []byte, v interface{}) error
67
-
```
70
+
It is recommended to use the github.com/cloudwego/prutal package directly.
68
71
69
-
prutal is compatible with protobuf generated code. So even if the original code was generated by the official protobuf, you can use prutal to serialise it for better performance.
72
+
```
73
+
// MarshalAppend appends the protobuf encoding of v to b and returns the new bytes
74
+
func MarshalAppend(b []byte, v interface{}) ([]byte, error)
70
75
71
-
Since protobuf is complex and has a lot of features, prutal can't guarantee 100% compatibility, so if you find any problems, please feel free to comment.
76
+
// Unmarshal parses the protobuf-encoded data and stores the result in the value pointed to by v.
77
+
func Unmarshal(b []byte, v interface{}) error
78
+
```
79
+
80
+
Prutal is compatible with Protobuf generated code. So even if the original code was generated by the official Protobuf, you can use Prutal to serialise it for better performance.
81
+
82
+
Since Protobuf is complex and has a lot of features, Prutal can't guarantee 100% compatibility, so if you find any problems, please feel free to pull an issue.
72
83
73
84
## **Feedback to us**
74
-
If you have any questions, you can submit an [issue](https://github.com/cloudwego/prutal/issues) to prutal for feedback.
85
+
86
+
If you have any questions, you can submit an [issue](https://github.com/cloudwego/prutal/issues) to Prutal for feedback.
0 commit comments