Skip to content

Commit 52687bd

Browse files
committed
doc: upload file User Guide to Generic Call for Streaming
1 parent b5e2299 commit 52687bd

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

content/en/docs/kitex/Tutorials/advanced-feature/generic-call/generic_streaming.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ description: ""
88

99
## Introduction
1010

11-
JSON generic call for streaming interfaces is now supported (client-side only).
12-
13-
**However, due to the ongoing restructuring of the streaming interface to improve the user experience and to avoid making any breaking changes after release, the feature's official release is temporarily on hold. If you have a need for this feature, you can refer to the following to try it out. Please note that once it is officially released, a small adjustment may be required on your end**.
14-
15-
Please try the feature with kitex test branch test/grpc_json_streaming_generic by `go get github.com/cloudwego/kitex@test/grpc_json_streaming_generic`.
11+
**JSON generic call for streaming interfaces is now supported (client-side only) from Kitex v0.12.0**.
1612

1713
## Usage
1814

@@ -54,6 +50,10 @@ The four methods included in the example IDL correspond to four scenarios:
5450
First of all, please initialize the streaming client. Here is an example of streaming client initialization.
5551

5652
```go
53+
import (
54+
dproto "github.com/cloudwego/dynamicgo/proto"
55+
)
56+
5757
dOpts := dproto.Options{} // you can specify parsing options as you want
5858
p, err := generic.NewPbFileProviderWithDynamicGo(your_idl, ctx, dOpts)
5959
// create json pb generic
@@ -102,7 +102,7 @@ The four methods included in the example IDL correspond to four scenarios:
102102
Here is an example of streaming client initialization.
103103

104104
```go
105-
p, err := generic.generic.NewThriftFileProvider(your_idl_path)
105+
p, err := generic.NewThriftFileProvider(your_idl_path)
106106
/*
107107
// if you use dynamicgo
108108
p, err := generic.NewThriftFileProviderWithDynamicGo(idl)
@@ -225,3 +225,29 @@ Example:
225225
resp, err := cli.GenericCall(ctx, "UnaryEcho", `{"message": "unary request"}`)
226226
strResp, ok := resp.(string) // response is json string
227227
```
228+
229+
## FAQ
230+
231+
### Recv() got err: rpc error: code = 12 desc = Method not found!
232+
233+
This error occurs when calling with Kitex **protobuf** generic streaming when the downstream is **gRPC-python** (gRPC libraries for other languages may also have this problem).
234+
235+
The root cause is that Kitex does not parse the package in the protobuf idl, so the package part of `:path` in the gPRC request is missing, and gRPC-python can't find the corresponding method.
236+
237+
e.g.
238+
239+
- normal client
240+
241+
`:path` - /search.gpt_engine.GPTStreamService/GPTGeneration
242+
243+
- protobuf generic client
244+
245+
`:path` - /GPTStreamService/GPTGeneration
246+
247+
#### Solution
248+
249+
Use the following branch to solve it and wait for the official release of Kitex v1.18.1 to fix this issue.
250+
251+
```shell
252+
go get -u github.com/cloudwego/[email protected]
253+
```

0 commit comments

Comments
 (0)