You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/02/09 09:27:38 UTC

[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #34: feat: add dubbo3 demo

AlexStocks commented on a change in pull request #34:
URL: https://github.com/apache/dubbo-go-samples/pull/34#discussion_r572721054



##########
File path: general/dubbo3/unary-client/dubbo3-client/cmd/client.go
##########
@@ -50,22 +51,73 @@ func main() {
 	time.Sleep(3 * time.Second)
 
 	gxlog.CInfo("\n\n\nstart to test dubbo")
-	reply := &dubbo3.Dubbo3HelloReply{}
-	req := &dubbo3.Dubbo3HelloRequest{
-		Myname: "jifeng",
-	}
+	//reply := &pb.Dubbo3HelloReply{}
+	//req := &pb.Dubbo3HelloRequest{
+	//	Myname: "jifeng",
+	//}
+	BigDataReq := pb.BigData{
+		WantSize: 271828,
+		Data: make([]byte, 314159),
+		}
+
+
 	ctx := context.Background()
 	ctx = context.WithValue(ctx, "tri-req-id", "test_value_XXXXXXXX")
 	wg := sync.WaitGroup{}
-	for i := 0; i < 1; i++ {
+
+	for i := 0; i < 100; i++ {
 		wg.Add(1)
 		go func() {
-			err := grpcGreeterImpl.Dubbo3SayHello2(ctx, req, reply)
-			if err != nil {
+			rsp, err := grpcGreeterImpl.BigUnaryTest(ctx, &BigDataReq)
+			if err != nil{
 				panic(err)
 			}
-			gxlog.CInfo("client response result: %v\n", reply)
-			//wg.Done()
+			fmt.Println("rsp len = ", len(rsp.Data))
+			time.Sleep(time.Second)
+
+			//rsp, err = grpcGreeterImpl.BigUnaryTest(context.Background(), &BigDataReq)

Review comment:
       If u do not  want to use the following codes, pls delete them.

##########
File path: go.sum
##########
@@ -100,13 +100,19 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
 github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
 github.com/alibaba/sentinel-golang v0.6.2 h1:1OjjpljJbNKWp9p5RJKxOqS1gHGZPUWPlCcokv5xYJs=
 github.com/alibaba/sentinel-golang v0.6.2/go.mod h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
+github.com/alibaba/sentinel-golang v1.0.1 h1:WlhN0XUxRyfkiDc8TO6CcRrnakwFP9zFtvJTYxZRCgI=

Review comment:
       using 'go mod tidy' to delete useless old version sentinel-golang.

##########
File path: general/dubbo3/stream-client/dubbo3-client/conf/client.yml
##########
@@ -10,26 +10,24 @@ connect_timeout: "3s"
 application:
   organization: "dubbo.io"
   name: "GreeterGrpcConsumer"
-  module: "dubbo-go greeter grpc client"
+  module: "dubbo-go3.0 greeter client"

Review comment:
       dubbo-go v3

##########
File path: general/dubbo3/server/dubbo3-server/conf/server.yml
##########
@@ -4,17 +4,16 @@
 application:
   organization: "dubbo.io"
   name: "GreeterGrpcServer"
-  module: "dubbo-go greeter grpc server"
+  module: "dubbo-go3.0 greeter server"

Review comment:
       dubbo-go v3

##########
File path: general/dubbo3/unary-client/grpc-client/main.go
##########
@@ -42,19 +41,66 @@ func main() {
 	c := pb.NewDubbo3GreeterClient(conn)
 
 	// Contact the client and print out its response.
-	name := defaultName
-	if len(os.Args) > 1 {
-		name = os.Args[1]
+	//name := defaultName
+	//if len(os.Args) > 1 {
+	//	name = os.Args[1]
+	//}
+	BigDataReq := pb.BigData{
+		WantSize: 271828,
+		Data: make([]byte, 314159),
 	}
+
 	wg := sync.WaitGroup{}
 	for i := 0; i < 100; i++ {
 		wg.Add(1)
 		go func() {
-			r, err := c.Dubbo3SayHello2(context.Background(), &pb.Dubbo3HelloRequest{Myname: name})
-			if err != nil {
-				log.Fatalf("could not greet: %v", err)
+			// Test Big Unary
+			rsp, err := c.BigUnaryTest(context.Background(), &BigDataReq)
+			if err != nil{
+				panic(err)
 			}
-			log.Printf("####### get client %+v", r)
+			fmt.Println("rsp len = ", len(rsp.Data))
+			////

Review comment:
       delete them.




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org