You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zt...@apache.org on 2021/12/17 09:49:10 UTC

[dubbo-go-samples] branch tmp/dubbo2http created (now ded8580)

This is an automated email from the ASF dual-hosted git repository.

ztelur pushed a change to branch tmp/dubbo2http
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git.


      at ded8580  update

This branch includes the following new commits:

     new 00519fa  update for test pixiu
     new 70193b1  commit
     new 66cd95b  commit
     new 6fef625  commit
     new ded8580  update

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[dubbo-go-samples] 02/05: commit

Posted by zt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ztelur pushed a commit to branch tmp/dubbo2http
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git

commit 70193b1f76d5c18e765334b6863f9547922f206d
Author: Randy <zt...@gmail.com>
AuthorDate: Fri Dec 17 17:30:37 2021 +0800

    commit
---
 .run/generic-default-go-server.run.xml  | 14 --------------
 generic/default/go-client/cmd/client.go |  6 +++---
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/.run/generic-default-go-server.run.xml b/.run/generic-default-go-server.run.xml
deleted file mode 100644
index 81c0495..0000000
--- a/.run/generic-default-go-server.run.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="generic-default-go-server" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="generic">
-    <module name="dubbo-go-samples" />
-    <working_directory value="$PROJECT_DIR$" />
-    <envs>
-      <env name="DUBBO_GO_CONFIG_PATH" value="$PROJECT_DIR$/generic/default/go-server/conf/dubbogo.yml" />
-    </envs>
-    <kind value="PACKAGE" />
-    <package value="github.com/apache/dubbo-go-samples/generic/default/go-server/cmd" />
-    <directory value="$PROJECT_DIR$/generic/default/go-server/cmd" />
-    <filePath value="$PROJECT_DIR$/generic/default/go-server/cmd/server.go" />
-    <method v="2" />
-  </configuration>
-</component>
\ No newline at end of file
diff --git a/generic/default/go-client/cmd/client.go b/generic/default/go-client/cmd/client.go
index ad36c2d..fd4bd4a 100644
--- a/generic/default/go-client/cmd/client.go
+++ b/generic/default/go-client/cmd/client.go
@@ -28,8 +28,8 @@ import (
 	"dubbo.apache.org/dubbo-go/v3/config/generic"
 	_ "dubbo.apache.org/dubbo-go/v3/imports"
 	"dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
-
 	hessian "github.com/apache/dubbo-go-hessian2"
+	tpconst "github.com/dubbogo/triple/pkg/common/constant"
 )
 
 import (
@@ -44,7 +44,7 @@ func main() {
 	hessian.RegisterPOJO(&pkg.User{})
 
 	// generic invocation samples using hessian serialization on Dubbo protocol
-	dubboRefConf := newRefConf("org.apache.dubbo.samples.UserProvider", dubbo.DUBBO)
+	dubboRefConf := newRefConf("org.apache.dubbo.samples.UserProvider", tpconst.TRIPLE)
 	callGetUser(dubboRefConf)
 
 }
@@ -193,7 +193,7 @@ func newRefConf(iface, protocol string) config.ReferenceConfig {
 		RegistryIDs:   []string{"zk"},
 		Protocol:      dubbo.DUBBO,
 		Generic:       "true",
-		URL:           "dubbo://127.0.0.1:8888/org.apache.dubbo.samples.UserProvider",
+		URL:           "dubbo://127.0.0.1:20001/org.apache.dubbo.samples.UserProvider",
 	}
 
 	rootConfig := config.NewRootConfigBuilder().

[dubbo-go-samples] 01/05: update for test pixiu

Posted by zt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ztelur pushed a commit to branch tmp/dubbo2http
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git

commit 00519fa7319d36f92a90c101124da8b59b8e4ec4
Author: Randy <zt...@gmail.com>
AuthorDate: Thu Dec 16 19:40:30 2021 +0800

    update for test pixiu
---
 .run/generic-default-go-client.run.xml  | 14 --------
 generic/default/go-client/cmd/client.go | 60 ++-------------------------------
 2 files changed, 3 insertions(+), 71 deletions(-)

diff --git a/.run/generic-default-go-client.run.xml b/.run/generic-default-go-client.run.xml
deleted file mode 100644
index 1d1006f..0000000
--- a/.run/generic-default-go-client.run.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="generic-default-go-client" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="generic">
-    <module name="dubbo-go-samples" />
-    <working_directory value="$PROJECT_DIR$" />
-    <envs>
-      <env name="DUBBO_GO_CONFIG_PATH" value="$PROJECT_DIR$/generic/default/go-client/conf/dubbogo.yml" />
-    </envs>
-    <kind value="PACKAGE" />
-    <package value="github.com/apache/dubbo-go-samples/generic/default/go-client/cmd" />
-    <directory value="$PROJECT_DIR$/generic/default/go-client/cmd" />
-    <filePath value="$PROJECT_DIR$/generic/default/go-client/cmd/client.go" />
-    <method v="2" />
-  </configuration>
-</component>
\ No newline at end of file
diff --git a/generic/default/go-client/cmd/client.go b/generic/default/go-client/cmd/client.go
index bbb14a3..ad36c2d 100644
--- a/generic/default/go-client/cmd/client.go
+++ b/generic/default/go-client/cmd/client.go
@@ -30,8 +30,6 @@ import (
 	"dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
 
 	hessian "github.com/apache/dubbo-go-hessian2"
-
-	tpconst "github.com/dubbogo/triple/pkg/common/constant"
 )
 
 import (
@@ -48,22 +46,6 @@ func main() {
 	// generic invocation samples using hessian serialization on Dubbo protocol
 	dubboRefConf := newRefConf("org.apache.dubbo.samples.UserProvider", dubbo.DUBBO)
 	callGetUser(dubboRefConf)
-	//callGetOneUser(dubboRefConf)
-	callGetUsers(dubboRefConf)
-	callGetUsersMap(dubboRefConf)
-	callQueryUser(dubboRefConf)
-	callQueryUsers(dubboRefConf)
-	//callQueryAll(dubboRefConf)
-
-	// generic invocation samples using hessian serialization on Triple protocol
-	tripleRefConf := newRefConf("org.apache.dubbo.samples.UserProviderTriple", tpconst.TRIPLE)
-	callGetUser(tripleRefConf)
-	//callGetOneUser(tripleRefConf)
-	callGetUsers(tripleRefConf)
-	callGetUsersMap(tripleRefConf)
-	callQueryUser(tripleRefConf)
-	callQueryUsers(tripleRefConf)
-	//callQueryAll(tripleRefConf)
 
 }
 
@@ -80,38 +62,6 @@ func callGetUser(refConf config.ReferenceConfig) {
 	}
 	logger.Infof("GetUser1(userId string) res: %+v", resp)
 
-	resp, err = refConf.GetRPCService().(*generic.GenericService).Invoke(
-		context.TODO(),
-		"GetUser2",
-		[]string{"java.lang.String", "java.lang.String"},
-		[]hessian.Object{"A003", "lily"},
-	)
-	if err != nil {
-		panic(err)
-	}
-	logger.Infof("GetUser2(userId string, name string) res: %+v", resp)
-
-	resp, err = refConf.GetRPCService().(*generic.GenericService).Invoke(
-		context.TODO(),
-		"GetUser3",
-		[]string{"int"},
-		[]hessian.Object{1},
-	)
-	if err != nil {
-		panic(err)
-	}
-	logger.Infof("GetUser3(userCode int) res: %+v", resp)
-
-	resp, err = refConf.GetRPCService().(*generic.GenericService).Invoke(
-		context.TODO(),
-		"GetUser4",
-		[]string{"int", "java.lang.String"},
-		[]hessian.Object{1, "zhangsan"},
-	)
-	if err != nil {
-		panic(err)
-	}
-	logger.Infof("GetUser4(userCode int, name string) res: %+v", resp)
 }
 
 // nolint
@@ -236,21 +186,17 @@ func callQueryAll(refConf config.ReferenceConfig) {
 }
 
 func newRefConf(iface, protocol string) config.ReferenceConfig {
-	registryConfig := &config.RegistryConfig{
-		Protocol: "zookeeper",
-		Address:  "127.0.0.1:2181",
-	}
 
 	refConf := config.ReferenceConfig{
-		InterfaceName: iface,
+		InterfaceName: "org.apache.dubbo.samples.UserProvider",
 		Cluster:       "failover",
 		RegistryIDs:   []string{"zk"},
-		Protocol:      protocol,
+		Protocol:      dubbo.DUBBO,
 		Generic:       "true",
+		URL:           "dubbo://127.0.0.1:8888/org.apache.dubbo.samples.UserProvider",
 	}
 
 	rootConfig := config.NewRootConfigBuilder().
-		AddRegistry("zk", registryConfig).
 		Build()
 	if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
 		panic(err)

[dubbo-go-samples] 03/05: commit

Posted by zt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ztelur pushed a commit to branch tmp/dubbo2http
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git

commit 66cd95bb86d01cd0cd3997d2aa38d9a2c6de7787
Author: Randy <zt...@gmail.com>
AuthorDate: Fri Dec 17 17:33:41 2021 +0800

    commit
---
 generic/default/go-client/cmd/client.go | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/generic/default/go-client/cmd/client.go b/generic/default/go-client/cmd/client.go
index fd4bd4a..e16bfb6 100644
--- a/generic/default/go-client/cmd/client.go
+++ b/generic/default/go-client/cmd/client.go
@@ -27,7 +27,6 @@ import (
 	"dubbo.apache.org/dubbo-go/v3/config"
 	"dubbo.apache.org/dubbo-go/v3/config/generic"
 	_ "dubbo.apache.org/dubbo-go/v3/imports"
-	"dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
 	hessian "github.com/apache/dubbo-go-hessian2"
 	tpconst "github.com/dubbogo/triple/pkg/common/constant"
 )
@@ -44,8 +43,8 @@ func main() {
 	hessian.RegisterPOJO(&pkg.User{})
 
 	// generic invocation samples using hessian serialization on Dubbo protocol
-	dubboRefConf := newRefConf("org.apache.dubbo.samples.UserProvider", tpconst.TRIPLE)
-	callGetUser(dubboRefConf)
+	tripleRefConf := newRefConf("org.apache.dubbo.samples.UserProviderTriple", tpconst.TRIPLE)
+	callGetUser(tripleRefConf)
 
 }
 
@@ -188,12 +187,12 @@ func callQueryAll(refConf config.ReferenceConfig) {
 func newRefConf(iface, protocol string) config.ReferenceConfig {
 
 	refConf := config.ReferenceConfig{
-		InterfaceName: "org.apache.dubbo.samples.UserProvider",
+		InterfaceName: iface,
 		Cluster:       "failover",
 		RegistryIDs:   []string{"zk"},
-		Protocol:      dubbo.DUBBO,
+		Protocol:      protocol,
 		Generic:       "true",
-		URL:           "dubbo://127.0.0.1:20001/org.apache.dubbo.samples.UserProvider",
+		URL:           "dubbo://127.0.0.1:20001/" + iface,
 	}
 
 	rootConfig := config.NewRootConfigBuilder().

[dubbo-go-samples] 04/05: commit

Posted by zt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ztelur pushed a commit to branch tmp/dubbo2http
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git

commit 6fef6255b9390cd47be704f2dfe808df21812736
Author: Randy <zt...@gmail.com>
AuthorDate: Fri Dec 17 17:43:07 2021 +0800

    commit
---
 generic/default/go-client/cmd/client.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generic/default/go-client/cmd/client.go b/generic/default/go-client/cmd/client.go
index e16bfb6..f3713b3 100644
--- a/generic/default/go-client/cmd/client.go
+++ b/generic/default/go-client/cmd/client.go
@@ -192,7 +192,7 @@ func newRefConf(iface, protocol string) config.ReferenceConfig {
 		RegistryIDs:   []string{"zk"},
 		Protocol:      protocol,
 		Generic:       "true",
-		URL:           "dubbo://127.0.0.1:20001/" + iface,
+		URL:           "tri://127.0.0.1:20001/" + iface,
 	}
 
 	rootConfig := config.NewRootConfigBuilder().

[dubbo-go-samples] 05/05: update

Posted by zt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ztelur pushed a commit to branch tmp/dubbo2http
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git

commit ded85805ff5cf6702f090a5d26e0f79b45c2a512
Author: Randy <zt...@gmail.com>
AuthorDate: Fri Dec 17 17:48:13 2021 +0800

    update
---
 generic/default/go-client/cmd/client.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generic/default/go-client/cmd/client.go b/generic/default/go-client/cmd/client.go
index f3713b3..f06857c 100644
--- a/generic/default/go-client/cmd/client.go
+++ b/generic/default/go-client/cmd/client.go
@@ -192,7 +192,7 @@ func newRefConf(iface, protocol string) config.ReferenceConfig {
 		RegistryIDs:   []string{"zk"},
 		Protocol:      protocol,
 		Generic:       "true",
-		URL:           "tri://127.0.0.1:20001/" + iface,
+		URL:           "tri://127.0.0.1:20001/" + iface + "?serialization=hessian2",
 	}
 
 	rootConfig := config.NewRootConfigBuilder().