You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/02/25 09:34:03 UTC

[GitHub] [apisix] shuaijinchao opened a new pull request #6451: test(grpc-web): add server-side streaming mode test case

shuaijinchao opened a new pull request #6451:
URL: https://github.com/apache/apisix/pull/6451


   ### What this PR does / why we need it:
   the current grpc-web plugin already supports server-side streaming mode requests for standard grpc-web requests.
   add test case for grpc-web plugin server-side streaming mode.
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the PR manners:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. If you need to resolve merge conflicts after the PR is reviewed, please merge master but do not rebase
   6. Use "request review" to notify the reviewer once you have resolved the review
   7. Only reviewer can click "Resolve conversation" to mark the reviewer's review resolved
   -->
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander merged pull request #6451: test(grpc-web): add server-side streaming mode test case

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #6451:
URL: https://github.com/apache/apisix/pull/6451


   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] shuaijinchao commented on a change in pull request #6451: test(grpc-web): add server-side streaming mode test case

Posted by GitBox <gi...@apache.org>.
shuaijinchao commented on a change in pull request #6451:
URL: https://github.com/apache/apisix/pull/6451#discussion_r815458205



##########
File path: t/plugin/grpc-web/server.go
##########
@@ -18,36 +18,89 @@
 package main
 
 import (
+	"context"
+	"encoding/json"
 	"flag"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/codes"
+	"google.golang.org/grpc/status"
 	"log"
 	"net"
-
-	"apisix.apache.org/plugin/grpc-web/a6"
-	"google.golang.org/grpc"
-	"google.golang.org/grpc/reflection"
+	pb "apisix.apache.org/plugin/grpc-web/a6"
 )
 
-var grpcListenAddress string
+type routeServiceServer struct {
+	savedRoutes []*pb.Route
+}
+
+func (rss *routeServiceServer) GetRoute(ctx context.Context, req *pb.Query) (*pb.Route, error) {

Review comment:
       hi, Zexuan, two methods are declared in proto, one is `GetRoute` for unary mode, and the other is `GetRoutes` for server-side streaming mode.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #6451: test(grpc-web): add server-side streaming mode test case

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #6451:
URL: https://github.com/apache/apisix/pull/6451#discussion_r815432485



##########
File path: t/plugin/grpc-web/server.go
##########
@@ -18,36 +18,89 @@
 package main
 
 import (
+	"context"
+	"encoding/json"
 	"flag"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/codes"
+	"google.golang.org/grpc/status"
 	"log"
 	"net"
-
-	"apisix.apache.org/plugin/grpc-web/a6"
-	"google.golang.org/grpc"
-	"google.golang.org/grpc/reflection"
+	pb "apisix.apache.org/plugin/grpc-web/a6"
 )
 
-var grpcListenAddress string
+type routeServiceServer struct {
+	savedRoutes []*pb.Route
+}
+
+func (rss *routeServiceServer) GetRoute(ctx context.Context, req *pb.Query) (*pb.Route, error) {

Review comment:
       Would be better to use a backend which responds the data streamingly to test




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org