This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 0eee127 3.0test (#102)
0eee127 is described below
commit 0eee127918c0915c7e9c0159dc0fc8b1d2c319f9
Author: Laurence <[email protected]>
AuthorDate: Sat May 15 14:18:21 2021 +0800
3.0test (#102)
* fix: fix test
* fix: delete unused change
* fix: change client.yml
* fix: 3.0 test
* fix: fix generic bug
* fix: updata inte test
---
.run/filter-tpslimit-client.run.xml | 15 ++
.run/general-dubbo-go-client.run.xml | 15 ++
.run/general-dubbo-go-server.run.xml | 15 ++
general/dubbo/go-client/cmd/client.go | 152 ---------------------
general/dubbo/go-client/conf/client.yml | 13 --
general/dubbo/go-server/conf/client.yml | 1 -
generic/go-client/cmd/client.go | 1 +
generic/go-server/tests/integration/main_test.go | 1 +
.../tests/integration/userprovider_test.go | 7 +-
go.mod | 3 +-
go.sum | 14 ++
registry/nacos/go-server/conf/client.yml | 2 +-
.../zookeeper/go-client/cmd/client.go | 55 ++++----
.../zookeeper/go-client}/conf/client.yml | 2 +-
registry/zookeeper/go-client/conf/log.yml | 27 ++++
.../zookeeper/go-client/pkg/user.go | 43 ++----
.../zookeeper/go-server/cmd/server.go | 68 +++++----
.../zookeeper}/go-server/conf/client.yml | 0
registry/zookeeper/go-server/conf/log.yml | 27 ++++
.../zookeeper/go-server/conf/server.yml | 36 +++--
.../zookeeper/go-server/docker/docker-compose.yml | 9 ++
.../zookeeper/go-server/pkg/user.go | 51 +++----
.../go-server/tests/integration/main_test.go | 37 ++---
.../tests/integration/userprovider_test.go | 39 ++++++
start_integrate_test.sh | 11 +-
25 files changed, 311 insertions(+), 333 deletions(-)
diff --git a/.run/filter-tpslimit-client.run.xml
b/.run/filter-tpslimit-client.run.xml
new file mode 100644
index 0000000..c9d2c62
--- /dev/null
+++ b/.run/filter-tpslimit-client.run.xml
@@ -0,0 +1,15 @@
+<component name="ProjectRunConfigurationManager">
+ <configuration default="false" name="filter-tpslimit-client"
type="GoApplicationRunConfiguration" factoryName="Go Application"
singleton="false">
+ <module name="dubbo-go-samples" />
+ <working_directory value="$PROJECT_DIR$" />
+ <envs>
+ <env name="APP_LOG_CONF_FILE"
value="$PROJECT_DIR$/filter/tpslimit/go-client/conf/log.yml" />
+ <env name="CONF_CONSUMER_FILE_PATH"
value="$PROJECT_DIR$/filter/tpslimit/go-client/conf/client.yml" />
+ </envs>
+ <kind value="PACKAGE" />
+ <filePath value="$PROJECT_DIR$/filter/sentinel/go-client/cmd/client.go" />
+ <package
value="github.com/apache/dubbo-go-samples/filter/tpslimit/go-client/cmd" />
+ <directory value="$PROJECT_DIR$" />
+ <method v="2" />
+ </configuration>
+</component>
\ No newline at end of file
diff --git a/.run/general-dubbo-go-client.run.xml
b/.run/general-dubbo-go-client.run.xml
new file mode 100644
index 0000000..e04219c
--- /dev/null
+++ b/.run/general-dubbo-go-client.run.xml
@@ -0,0 +1,15 @@
+<component name="ProjectRunConfigurationManager">
+ <configuration default="false" name="general-dubbo-go-client"
type="GoApplicationRunConfiguration" factoryName="Go Application"
folderName="general">
+ <module name="dubbo-go-samples" />
+ <working_directory value="$PROJECT_DIR$" />
+ <envs>
+ <env name="CONF_CONSUMER_FILE_PATH"
value="$PROJECT_DIR$/general/dubbo/go-client/conf/client.yml" />
+ <env name="APP_LOG_CONF_FILE"
value="$PROJECT_DIR$/general/general/dubbo/go-client/conf/log.yml" />
+ </envs>
+ <kind value="PACKAGE" />
+ <filePath value="$PROJECT_DIR$/general/grpc/unary/go-client/app/client.go"
/>
+ <package
value="github.com/apache/dubbo-go-samples/general/dubbo/go-client/cmd" />
+ <directory value="$PROJECT_DIR$" />
+ <method v="2" />
+ </configuration>
+</component>
\ No newline at end of file
diff --git a/.run/general-dubbo-go-server.run.xml
b/.run/general-dubbo-go-server.run.xml
new file mode 100644
index 0000000..d464b91
--- /dev/null
+++ b/.run/general-dubbo-go-server.run.xml
@@ -0,0 +1,15 @@
+<component name="ProjectRunConfigurationManager">
+ <configuration default="false" name="general-dubbo-go-server"
type="GoApplicationRunConfiguration" factoryName="Go Application"
folderName="general">
+ <module name="dubbo-go-samples" />
+ <working_directory value="$PROJECT_DIR$" />
+ <envs>
+ <env name="APP_LOG_CONF_FILE"
value="$PROJECT_DIR$/general/dubbo/go-server/conf/log.yml" />
+ <env name="CONF_PROVIDER_FILE_PATH"
value="$PROJECT_DIR$/general/dubbo/go-server/conf/server.yml" />
+ </envs>
+ <kind value="PACKAGE" />
+ <filePath value="$PROJECT_DIR$/general/grpc/unary/go-server/app/server.go"
/>
+ <package
value="github.com/apache/dubbo-go-samples/general/dubbo/go-server/cmd" />
+ <directory value="$PROJECT_DIR$" />
+ <method v="2" />
+ </configuration>
+</component>
\ No newline at end of file
diff --git a/general/dubbo/go-client/cmd/client.go
b/general/dubbo/go-client/cmd/client.go
index c8484e1..3adb200 100644
--- a/general/dubbo/go-client/cmd/client.go
+++ b/general/dubbo/go-client/cmd/client.go
@@ -41,8 +41,6 @@ import (
var (
userProvider = new(pkg.UserProvider)
- userProvider1 = new(pkg.UserProvider1)
- userProvider2 = new(pkg.UserProvider2)
)
// need to setup environment variable "CONF_CONSUMER_FILE_PATH" to
"conf/client.yml" before run
@@ -53,23 +51,15 @@ func main() {
config.SetConsumerService(userProvider)
- // FIXME: cannot make multi-references work
- config.SetConsumerService(userProvider1)
- config.SetConsumerService(userProvider2)
config.Load()
time.Sleep(6 * time.Second)
gxlog.CInfo("\n\ntest")
test()
- gxlog.CInfo("\n\ntest1")
- test1()
- gxlog.CInfo("\n\ntest2")
- test2()
}
func test() {
-
gxlog.CInfo("\n\n\necho")
res, err := userProvider.Echo(context.TODO(), "OK")
if err != nil {
@@ -146,145 +136,3 @@ func test() {
}
gxlog.CInfo("error: %v", err)
}
-
-func test1() {
- gxlog.CInfo("\n\n\necho")
- res, err := userProvider1.Echo(context.TODO(), "OK")
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("res: %v\n", res)
-
- gxlog.CInfo("\n\n\nstart to test dubbo")
- user := &pkg.User{}
- err = userProvider1.GetUser(context.TODO(), []interface{}{"A003"}, user)
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", user)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - GetUser0")
- ret, err := userProvider1.GetUser0("A003", "Moorse")
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", ret)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - GetUsers")
- ret1, err := userProvider1.GetUsers([]interface{}{[]interface{}{"A002",
"A003"}})
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", ret1)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - getUser")
- user = &pkg.User{}
- var i int32 = 1
- err = userProvider1.GetUser2(context.TODO(), []interface{}{i}, user)
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", user)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - getUser - overload")
- user = &pkg.User{}
- err = userProvider1.GetUser2(context.TODO(), []interface{}{i,
"overload"}, user)
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", user)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - GetUser3")
- err = userProvider1.GetUser3()
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("succ!")
-
- gxlog.CInfo("\n\n\nstart to test dubbo - getErr")
- user = &pkg.User{}
- err = userProvider1.GetErr(context.TODO(), []interface{}{"A003"}, user)
- if err == nil {
- panic("err is nil")
- }
- gxlog.CInfo("getErr - error: %v", err)
-
- gxlog.CInfo("\n\n\nstart to test dubbo illegal method")
- err = userProvider1.GetUser1(context.TODO(), []interface{}{"A003"},
user)
- if err == nil {
- panic("err is nil")
- }
- gxlog.CInfo("error: %v", err)
-}
-
-func test2() {
- gxlog.CInfo("\n\n\necho")
- res, err := userProvider2.Echo(context.TODO(), "OK")
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("res: %v\n", res)
-
- time.Sleep(3e9)
-
- gxlog.CInfo("\n\n\nstart to test dubbo")
- user := &pkg.User{}
- err = userProvider2.GetUser(context.TODO(), []interface{}{"A003"}, user)
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", user)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - GetUser0")
- ret, err := userProvider2.GetUser0("A003", "Moorse")
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", ret)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - GetUsers")
- ret1, err := userProvider2.GetUsers([]interface{}{[]interface{}{"A002",
"A003"}})
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", ret1)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - getUser")
- user = &pkg.User{}
- var i int32 = 1
- err = userProvider2.GetUser2(context.TODO(), []interface{}{i}, user)
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", user)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - getUser - overload")
- user = &pkg.User{}
- err = userProvider2.GetUser2(context.TODO(), []interface{}{i,
"overload"}, user)
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("response result: %v", user)
-
- gxlog.CInfo("\n\n\nstart to test dubbo - GetUser3")
- err = userProvider2.GetUser3()
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("succ!")
-
- gxlog.CInfo("\n\n\nstart to test dubbo - getErr")
- user = &pkg.User{}
- err = userProvider2.GetErr(context.TODO(), []interface{}{"A003"}, user)
- if err == nil {
- panic("err is nil")
- }
- gxlog.CInfo("getErr - error: %v", err)
-
- gxlog.CInfo("\n\n\nstart to test dubbo illegal method")
- err = userProvider2.GetUser1(context.TODO(), []interface{}{"A003"},
user)
- if err == nil {
- panic("err is nil")
- }
- gxlog.CInfo("error: %v", err)
-}
diff --git a/general/dubbo/go-client/conf/client.yml
b/general/dubbo/go-client/conf/client.yml
index 92b0a62..d744d39 100644
--- a/general/dubbo/go-client/conf/client.yml
+++ b/general/dubbo/go-client/conf/client.yml
@@ -30,19 +30,6 @@ references:
protocol: "dubbo"
interface: "org.apache.dubbo.UserProvider"
cluster: "failover"
- "UserProvider1":
- registry: "demoZk"
- protocol: "dubbo"
- version: "2.0"
- interface: "org.apache.dubbo.UserProvider"
- cluster: "failover"
- "UserProvider2":
- registry: "demoZk"
- protocol: "dubbo"
- group: "as"
- version: "2.0"
- interface: "org.apache.dubbo.UserProvider"
- cluster: "failover"
# protocol config
protocol_conf:
diff --git a/general/dubbo/go-server/conf/client.yml
b/general/dubbo/go-server/conf/client.yml
index 11ae382..f8c56cb 100644
--- a/general/dubbo/go-server/conf/client.yml
+++ b/general/dubbo/go-server/conf/client.yml
@@ -33,7 +33,6 @@ references:
methods:
- name: "GetUser"
retries: 3
-
# protocol config
protocol_conf:
dubbo:
diff --git a/generic/go-client/cmd/client.go b/generic/go-client/cmd/client.go
index c0797bc..b5d6b48 100644
--- a/generic/go-client/cmd/client.go
+++ b/generic/go-client/cmd/client.go
@@ -55,6 +55,7 @@ var (
)
func init() {
+ config.Load()
referenceConfig.GenericLoad(appName) //appName is the unique
identification of RPCService
time.Sleep(3 * time.Second)
}
diff --git a/generic/go-server/tests/integration/main_test.go
b/generic/go-server/tests/integration/main_test.go
index 1c41feb..e653dbe 100644
--- a/generic/go-server/tests/integration/main_test.go
+++ b/generic/go-server/tests/integration/main_test.go
@@ -47,6 +47,7 @@ var referenceConfig = config.ReferenceConfig{
}
func TestMain(m *testing.M) {
+ config.Load()
referenceConfig.GenericLoad(appName)
time.Sleep(3 * time.Second)
diff --git a/generic/go-server/tests/integration/userprovider_test.go
b/generic/go-server/tests/integration/userprovider_test.go
index 3c095df..65316fc 100644
--- a/generic/go-server/tests/integration/userprovider_test.go
+++ b/generic/go-server/tests/integration/userprovider_test.go
@@ -21,6 +21,7 @@ package integration
import (
"context"
+ "fmt"
"github.com/stretchr/testify/assert"
"testing"
"time"
@@ -38,13 +39,13 @@ func TestGetUser(t *testing.T) {
[]interface{}{"A003"},
},
)
-
+ fmt.Println("============", o)
assert.Nil(t, err)
assert.IsType(t, make(map[interface{}]interface{}, 0), o)
resp := o.(map[interface{}]interface{})
assert.Equal(t, "Alex Stocks", resp["name"])
assert.Equal(t, int32(18), resp["age"])
- assert.Equal(t, "A001", resp["id"])
+ assert.Equal(t, "A001", resp["iD"])
}
func TestQueryUser(t *testing.T) {
@@ -69,5 +70,5 @@ func TestQueryUser(t *testing.T) {
resp := o.(map[interface{}]interface{})
assert.Equal(t, "panty", resp["name"])
assert.Equal(t, int32(25), resp["age"])
- assert.Equal(t, "3213", resp["id"])
+ assert.Equal(t, "3213", resp["iD"])
}
diff --git a/go.mod b/go.mod
index 3766a52..95b27cc 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,7 @@
module github.com/apache/dubbo-go-samples
require (
- dubbo.apache.org/dubbo-go/v3 v3.0.0-20210510003552-d1e76d9fe76f
+ dubbo.apache.org/dubbo-go/v3 v3.0.0-20210515020035-d385de50d0a6
github.com/alibaba/sentinel-golang v1.0.2
github.com/apache/dubbo-getty v1.4.3
github.com/apache/dubbo-go-hessian2 v1.9.1
@@ -19,6 +19,7 @@ require (
github.com/transaction-wg/seata-golang v0.2.0
github.com/uber/jaeger-client-go v2.22.1+incompatible
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
+ github.com/vmihailenco/msgpack/v5 v5.3.1
golang.org/x/net v0.0.0-20201224014010-6772e930b67b
google.golang.org/grpc v1.36.0
google.golang.org/grpc/examples v0.0.0-20210402181922-5730f8d113ee //
indirect
diff --git a/go.sum b/go.sum
index 0b8ba55..3eea9fc 100644
--- a/go.sum
+++ b/go.sum
@@ -17,6 +17,10 @@ contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod
h1:450APlNTSR6FrvC3CTRq
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod
h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dubbo.apache.org/dubbo-go/v3 v3.0.0-20210510003552-d1e76d9fe76f
h1:41dJHh03e5qQVF2fxYH4pbtScj11ta0sISRswE8+y70=
dubbo.apache.org/dubbo-go/v3 v3.0.0-20210510003552-d1e76d9fe76f/go.mod
h1:MzWXTcEHFQFtqGFVdmwDFna1m/8H01gj2H/T3ENP6ug=
+dubbo.apache.org/dubbo-go/v3 v3.0.0-20210513052510-3c1605204aed
h1:SCTVkBx3ObDtoTnytxi8lhkcBv1tVuHyM2H6Ui0meQw=
+dubbo.apache.org/dubbo-go/v3 v3.0.0-20210513052510-3c1605204aed/go.mod
h1:YVaLJ7heyFq46P5XgvRpjBmV0HhebTmK/astjJCWoo4=
+dubbo.apache.org/dubbo-go/v3 v3.0.0-20210515020035-d385de50d0a6
h1:70EDnWLjVedhcbohclV9+lLaBX5b7G3+2LAQtzjpsXU=
+dubbo.apache.org/dubbo-go/v3 v3.0.0-20210515020035-d385de50d0a6/go.mod
h1:YVaLJ7heyFq46P5XgvRpjBmV0HhebTmK/astjJCWoo4=
dubbo.apache.org/dubbo-go/v3/ v3.0.0-20210510003552-d1e76d9fe76f
h1:41dJHh03e5qQVF2fxYH4pbtScj11ta0sISRswE8+y70=
dubbo.apache.org/dubbo-go/v3/ v3.0.0-20210510003552-d1e76d9fe76f/go.mod
h1:MzWXTcEHFQFtqGFVdmwDFna1m/8H01gj2H/T3ENP6ug=
dubbo.apache.org/dubbo-go/v3/protocol/dubbo3/protoc-gen-dubbo3
v0.0.0-20210409035047-6463de0e1668
h1:WRpkHYsNBzFeiQvv3qAmlp0DLJ3KHAhv1BOCiB28I4Q=
@@ -87,6 +91,8 @@ github.com/RoaringBitmap/roaring v0.5.5
h1:naNqvO1mNnghk2UvcsqnzHDBn9DRbCIRy94Gm
github.com/RoaringBitmap/roaring v0.5.5/go.mod
h1:puNo5VdzwbaIQxSiDIwfXl4Hnc+fbovcX4IW/dSTtUk=
github.com/RoaringBitmap/roaring v0.6.0
h1:tZcn2nJpUrZf+xQY8x+9QY7BxSETMjkdNG4Ts5zahyU=
github.com/RoaringBitmap/roaring v0.6.0/go.mod
h1:WZ83fjBF/7uBHi6QoFyfGL4+xuV4Qn+xFkm4+vSzrhE=
+github.com/RoaringBitmap/roaring v0.6.1
h1:O36Tdaj1Fi/zyr25shTHwlQPGdq53+u4WkM08AOEjiE=
+github.com/RoaringBitmap/roaring v0.6.1/go.mod
h1:WZ83fjBF/7uBHi6QoFyfGL4+xuV4Qn+xFkm4+vSzrhE=
github.com/Shopify/sarama v1.19.0/go.mod
h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod
h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod
h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
@@ -225,6 +231,7 @@ github.com/coreos/go-semver v0.2.0/go.mod
h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
github.com/coreos/go-semver v0.3.0
h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod
h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod
h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod
h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod
h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU=
@@ -557,6 +564,7 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod
h1:8NvIoxWQoOIhqOTXgf
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod
h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod
h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod
h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
+github.com/grpc-ecosystem/grpc-gateway v1.14.6
h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMchFtkdrS4BIj5o=
github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod
h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw=
github.com/grpc-ecosystem/grpc-gateway v1.16.0
h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod
h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
@@ -1130,6 +1138,11 @@ github.com/urfave/cli/v2 v2.2.0/go.mod
h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2
github.com/valyala/bytebufferpool v1.0.0/go.mod
h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod
h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.1.0/go.mod
h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
+github.com/vmihailenco/msgpack v4.0.4+incompatible
h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
+github.com/vmihailenco/msgpack/v5 v5.3.1
h1:0i85a4dsZh8mC//wmyyTEzidDLPQfQAxZIOLtafGbFY=
+github.com/vmihailenco/msgpack/v5 v5.3.1/go.mod
h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
+github.com/vmihailenco/tagparser/v2 v2.0.0
h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
+github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod
h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/vmware/govmomi v0.18.0
h1:f7QxSmP7meCtoAmiKZogvVbLInT+CZx6Px6K5rYsJZo=
github.com/vmware/govmomi v0.18.0/go.mod
h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
github.com/vultr/govultr v0.1.4/go.mod
h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
@@ -1475,6 +1488,7 @@ google.golang.org/grpc v1.36.0
h1:o1bcQ6imQMIOpdrO3SWf2z5RV72WbDwdXuK0MDlc8As=
google.golang.org/grpc v1.36.0/go.mod
h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1 h1:cmUfbeGKnz9+2DD/UYsMQXeqbHZqZDs4eQwW0sFOpBY=
google.golang.org/grpc v1.37.0 h1:uSZWeQJX5j11bIQ4AJoj+McDBo29cY1MCoC1wO3ts+c=
+google.golang.org/grpc v1.37.1 h1:ARnQJNWxGyYJpdf/JXscNlQr/uv607ZPU9Z7ogHi+iI=
google.golang.org/grpc/examples v0.0.0-20210402181922-5730f8d113ee
h1:ce4FrZMLOYgL8xpCBN3O7pLTd/XNTT8BL5BPiDaG+/4=
google.golang.org/grpc/examples v0.0.0-20210402181922-5730f8d113ee/go.mod
h1:Ly7ZA/ARzg8fnPU9TyZIxoz33sEUuWX7txiqs8lPTgE=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod
h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
diff --git a/registry/nacos/go-server/conf/client.yml
b/registry/nacos/go-server/conf/client.yml
index df63bb7..d9e9c87 100644
--- a/registry/nacos/go-server/conf/client.yml
+++ b/registry/nacos/go-server/conf/client.yml
@@ -18,7 +18,7 @@ application:
registries:
"nacos":
protocol: "nacos"
- timeout : "3s"
+ timeout: "3s"
address: "127.0.0.1:8848"
# reference config
diff --git a/generic/go-server/tests/integration/main_test.go
b/registry/zookeeper/go-client/cmd/client.go
similarity index 64%
copy from generic/go-server/tests/integration/main_test.go
copy to registry/zookeeper/go-client/cmd/client.go
index 1c41feb..76a71bc 100644
--- a/generic/go-server/tests/integration/main_test.go
+++ b/registry/zookeeper/go-client/cmd/client.go
@@ -1,5 +1,3 @@
-// +build integration
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -17,7 +15,13 @@
* limitations under the License.
*/
-package integration
+package main
+
+import (
+ "context"
+ "os"
+ "time"
+)
import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
@@ -25,41 +29,36 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
"dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+ hessian "github.com/apache/dubbo-go-hessian2"
+ gxlog "github.com/dubbogo/gost/log"
)
import (
- "os"
- "testing"
- "time"
+ "github.com/apache/dubbo-go-samples/registry/zookeeper/go-client/pkg"
)
-var appName = "UserConsumerTest"
-var referenceConfig = config.ReferenceConfig{
- InterfaceName: "org.apache.dubbo.UserProvider",
- Cluster: "failover",
- Registry: "demoZk",
- Protocol: dubbo.DUBBO,
- Generic: true,
-}
-
-func TestMain(m *testing.M) {
- referenceConfig.GenericLoad(appName)
- time.Sleep(3 * time.Second)
+var userProvider = new(pkg.UserProvider)
- os.Exit(m.Run())
+func init() {
+ config.SetConsumerService(userProvider)
+ hessian.RegisterPOJO(&pkg.User{})
}
-type User struct {
- ID string
- Name string
- Age int32
- Time time.Time
-}
+// need to setup environment variable "CONF_CONSUMER_FILE_PATH" to
"conf/client.yml" before run
+func main() {
+ config.Load()
+ time.Sleep(3 * time.Second)
-func (User) JavaClassName() string {
- return "org.apache.dubbo.User"
+ gxlog.CInfo("\n\n\nstart to test dubbo")
+ user := &pkg.User{}
+ err := userProvider.GetUser(context.TODO(), []interface{}{"A001"}, user)
+ if err != nil {
+ gxlog.CError("error: %v\n", err)
+ os.Exit(1)
+ return
+ }
+ gxlog.CInfo("response result: %v\n", user)
}
diff --git a/general/dubbo/go-server/conf/client.yml
b/registry/zookeeper/go-client/conf/client.yml
similarity index 97%
copy from general/dubbo/go-server/conf/client.yml
copy to registry/zookeeper/go-client/conf/client.yml
index 11ae382..308d530 100644
--- a/general/dubbo/go-server/conf/client.yml
+++ b/registry/zookeeper/go-client/conf/client.yml
@@ -9,7 +9,7 @@ connect_timeout: "3s"
# application config
application:
organization: "dubbo.io"
- name: "UserInfoTest"
+ name: "UserInfoClient"
module: "dubbo-go user-info client"
version: "0.0.1"
environment: "dev"
diff --git a/registry/zookeeper/go-client/conf/log.yml
b/registry/zookeeper/go-client/conf/log.yml
new file mode 100644
index 0000000..2b6e93a
--- /dev/null
+++ b/registry/zookeeper/go-client/conf/log.yml
@@ -0,0 +1,27 @@
+level: "debug"
+development: true
+disableCaller: false
+disableStacktrace: false
+sampling:
+encoding: "console"
+
+# encoder
+encoderConfig:
+ messageKey: "message"
+ levelKey: "level"
+ timeKey: "time"
+ nameKey: "logger"
+ callerKey: "caller"
+ stacktraceKey: "stacktrace"
+ lineEnding: ""
+ levelEncoder: "capital"
+ timeEncoder: "iso8601"
+ durationEncoder: "seconds"
+ callerEncoder: "short"
+ nameEncoder: ""
+
+outputPaths:
+ - "stderr"
+errorOutputPaths:
+ - "stderr"
+initialFields:
diff --git a/generic/go-server/tests/integration/main_test.go
b/registry/zookeeper/go-client/pkg/user.go
similarity index 52%
copy from generic/go-server/tests/integration/main_test.go
copy to registry/zookeeper/go-client/pkg/user.go
index 1c41feb..7733ea4 100644
--- a/generic/go-server/tests/integration/main_test.go
+++ b/registry/zookeeper/go-client/pkg/user.go
@@ -1,5 +1,3 @@
-// +build integration
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -17,42 +15,13 @@
* limitations under the License.
*/
-package integration
-
-import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
-)
+package pkg
import (
- "os"
- "testing"
+ "context"
"time"
)
-var appName = "UserConsumerTest"
-var referenceConfig = config.ReferenceConfig{
- InterfaceName: "org.apache.dubbo.UserProvider",
- Cluster: "failover",
- Registry: "demoZk",
- Protocol: dubbo.DUBBO,
- Generic: true,
-}
-
-func TestMain(m *testing.M) {
- referenceConfig.GenericLoad(appName)
- time.Sleep(3 * time.Second)
-
- os.Exit(m.Run())
-}
-
type User struct {
ID string
Name string
@@ -60,6 +29,14 @@ type User struct {
Time time.Time
}
+type UserProvider struct {
+ GetUser func(ctx context.Context, req []interface{}, rsp *User) error
+}
+
+func (u *UserProvider) Reference() string {
+ return "UserProvider"
+}
+
func (User) JavaClassName() string {
return "org.apache.dubbo.User"
}
diff --git a/generic/go-server/tests/integration/main_test.go
b/registry/zookeeper/go-server/cmd/server.go
similarity index 53%
copy from generic/go-server/tests/integration/main_test.go
copy to registry/zookeeper/go-server/cmd/server.go
index 1c41feb..e2cfe42 100644
--- a/generic/go-server/tests/integration/main_test.go
+++ b/registry/zookeeper/go-server/cmd/server.go
@@ -1,5 +1,3 @@
-// +build integration
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -17,49 +15,65 @@
* limitations under the License.
*/
-package integration
+package main
+
+import (
+ "fmt"
+ "os"
+ "os/signal"
+ "syscall"
+ "time"
+)
import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
+ "dubbo.apache.org/dubbo-go/v3/common/logger"
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
"dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+ hessian "github.com/apache/dubbo-go-hessian2"
)
import (
- "os"
- "testing"
- "time"
+ "github.com/apache/dubbo-go-samples/registry/zookeeper/go-server/pkg"
)
-var appName = "UserConsumerTest"
-var referenceConfig = config.ReferenceConfig{
- InterfaceName: "org.apache.dubbo.UserProvider",
- Cluster: "failover",
- Registry: "demoZk",
- Protocol: dubbo.DUBBO,
- Generic: true,
-}
+var (
+ survivalTimeout = int(3e9)
+)
-func TestMain(m *testing.M) {
- referenceConfig.GenericLoad(appName)
- time.Sleep(3 * time.Second)
+// need to setup environment variable "CONF_PROVIDER_FILE_PATH" to
"conf/server.yml" before run
+func main() {
+ hessian.RegisterPOJO(&pkg.User{})
+ config.SetProviderService(new(pkg.UserProvider))
+ config.Load()
- os.Exit(m.Run())
+ initSignal()
}
-type User struct {
- ID string
- Name string
- Age int32
- Time time.Time
-}
+func initSignal() {
+ signals := make(chan os.Signal, 1)
+ // It is not possible to block SIGKILL or syscall.SIGSTOP
+ signal.Notify(signals, os.Interrupt, os.Kill, syscall.SIGHUP,
syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
+ for {
+ sig := <-signals
+ logger.Infof("get signal %s", sig.String())
+ switch sig {
+ case syscall.SIGHUP:
+ // reload()
+ default:
+ time.AfterFunc(time.Duration(survivalTimeout), func() {
+ logger.Warnf("app exit now by force...")
+ os.Exit(1)
+ })
-func (User) JavaClassName() string {
- return "org.apache.dubbo.User"
+ // The program exits normally or timeout forcibly exits.
+ fmt.Println("provider app exit now...")
+ return
+ }
+ }
}
diff --git a/general/dubbo/go-server/conf/client.yml
b/registry/zookeeper/go-server/conf/client.yml
similarity index 100%
copy from general/dubbo/go-server/conf/client.yml
copy to registry/zookeeper/go-server/conf/client.yml
diff --git a/registry/zookeeper/go-server/conf/log.yml
b/registry/zookeeper/go-server/conf/log.yml
new file mode 100644
index 0000000..970d988
--- /dev/null
+++ b/registry/zookeeper/go-server/conf/log.yml
@@ -0,0 +1,27 @@
+level: "error"
+development: true
+disableCaller: false
+disableStacktrace: false
+sampling:
+encoding: "console"
+
+# encoder
+encoderConfig:
+ messageKey: "message"
+ levelKey: "level"
+ timeKey: "time"
+ nameKey: "logger"
+ callerKey: "caller"
+ stacktraceKey: "stacktrace"
+ lineEnding: ""
+ levelEncoder: "capital"
+ timeEncoder: "iso8601"
+ durationEncoder: "seconds"
+ callerEncoder: "short"
+ nameEncoder: ""
+
+outputPaths:
+ - "stderr"
+errorOutputPaths:
+ - "stderr"
+initialFields:
diff --git a/general/dubbo/go-server/conf/client.yml
b/registry/zookeeper/go-server/conf/server.yml
similarity index 66%
copy from general/dubbo/go-server/conf/client.yml
copy to registry/zookeeper/go-server/conf/server.yml
index 11ae382..af90434 100644
--- a/general/dubbo/go-server/conf/client.yml
+++ b/registry/zookeeper/go-server/conf/server.yml
@@ -1,16 +1,10 @@
-# dubbo client yaml configure file
-
-check: true
-# client
-request_timeout: "3s"
-# connect timeout
-connect_timeout: "3s"
+# dubbo server yaml configure file
# application config
application:
organization: "dubbo.io"
- name: "UserInfoTest"
- module: "dubbo-go user-info client"
+ name: "UserInfoServer"
+ module: "dubbo-go user-info server"
version: "0.0.1"
environment: "dev"
@@ -20,29 +14,31 @@ registries:
protocol: "zookeeper"
timeout: "3s"
address: "127.0.0.1:2181"
- username: ""
- password: ""
-# reference config
-references:
+# service config
+services:
"UserProvider":
registry: "demoZk"
protocol: "dubbo"
interface: "org.apache.dubbo.UserProvider"
+ loadbalance: "random"
+ warmup: "100"
cluster: "failover"
methods:
- name: "GetUser"
- retries: 3
+ retries: 1
+ loadbalance: "random"
# protocol config
+protocols:
+ "dubbo":
+ name: "dubbo"
+ port: 20000
+
protocol_conf:
dubbo:
- reconnect_interval: 0
- connection_number: 1
- heartbeat_period: "5s"
+ session_number: 700
session_timeout: "180s"
- pool_size: 64
- pool_ttl: 600
getty_session_param:
compress_encoding: false
tcp_no_delay: true
@@ -56,4 +52,4 @@ protocol_conf:
tcp_write_timeout: "5s"
wait_timeout: "1s"
max_msg_len: 1024000
- session_name: "client"
+ session_name: "server"
diff --git a/registry/zookeeper/go-server/docker/docker-compose.yml
b/registry/zookeeper/go-server/docker/docker-compose.yml
new file mode 100644
index 0000000..8724179
--- /dev/null
+++ b/registry/zookeeper/go-server/docker/docker-compose.yml
@@ -0,0 +1,9 @@
+version: '3'
+
+services:
+ zookeeper:
+ image: zookeeper
+ ports:
+ - 2181:2181
+ restart: on-failure
+
diff --git a/generic/go-server/tests/integration/main_test.go
b/registry/zookeeper/go-server/pkg/user.go
similarity index 51%
copy from generic/go-server/tests/integration/main_test.go
copy to registry/zookeeper/go-server/pkg/user.go
index 1c41feb..8e34bf0 100644
--- a/generic/go-server/tests/integration/main_test.go
+++ b/registry/zookeeper/go-server/pkg/user.go
@@ -1,5 +1,3 @@
-// +build integration
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -17,42 +15,17 @@
* limitations under the License.
*/
-package integration
+package pkg
import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+ "context"
+ "time"
)
import (
- "os"
- "testing"
- "time"
+ "github.com/dubbogo/gost/log"
)
-var appName = "UserConsumerTest"
-var referenceConfig = config.ReferenceConfig{
- InterfaceName: "org.apache.dubbo.UserProvider",
- Cluster: "failover",
- Registry: "demoZk",
- Protocol: dubbo.DUBBO,
- Generic: true,
-}
-
-func TestMain(m *testing.M) {
- referenceConfig.GenericLoad(appName)
- time.Sleep(3 * time.Second)
-
- os.Exit(m.Run())
-}
-
type User struct {
ID string
Name string
@@ -60,6 +33,20 @@ type User struct {
Time time.Time
}
-func (User) JavaClassName() string {
+type UserProvider struct {
+}
+
+func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User,
error) {
+ gxlog.CInfo("req:%#v", req)
+ rsp := User{"A001", "Alex Stocks", 18, time.Now()}
+ gxlog.CInfo("rsp:%#v", rsp)
+ return &rsp, nil
+}
+
+func (u *UserProvider) Reference() string {
+ return "UserProvider"
+}
+
+func (u User) JavaClassName() string {
return "org.apache.dubbo.User"
}
diff --git a/generic/go-server/tests/integration/main_test.go
b/registry/zookeeper/go-server/tests/integration/main_test.go
similarity index 78%
copy from generic/go-server/tests/integration/main_test.go
copy to registry/zookeeper/go-server/tests/integration/main_test.go
index 1c41feb..9fb0d96 100644
--- a/generic/go-server/tests/integration/main_test.go
+++ b/registry/zookeeper/go-server/tests/integration/main_test.go
@@ -20,34 +20,31 @@
package integration
import (
+ "context"
+ "os"
+ "testing"
+ "time"
+)
+
+import (
+ hessian "github.com/apache/dubbo-go-hessian2"
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
"dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
+ _ "dubbo.apache.org/dubbo-go/v3/metadata/service/inmemory"
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
)
-import (
- "os"
- "testing"
- "time"
-)
-
-var appName = "UserConsumerTest"
-var referenceConfig = config.ReferenceConfig{
- InterfaceName: "org.apache.dubbo.UserProvider",
- Cluster: "failover",
- Registry: "demoZk",
- Protocol: dubbo.DUBBO,
- Generic: true,
-}
+var userProvider = new(UserProvider)
func TestMain(m *testing.M) {
- referenceConfig.GenericLoad(appName)
+ config.SetConsumerService(userProvider)
+ hessian.RegisterPOJO(&User{})
+ config.Load()
time.Sleep(3 * time.Second)
os.Exit(m.Run())
@@ -60,6 +57,14 @@ type User struct {
Time time.Time
}
+type UserProvider struct {
+ GetUser func(ctx context.Context, req []interface{}, rsp *User) error
+}
+
+func (u *UserProvider) Reference() string {
+ return "UserProvider"
+}
+
func (User) JavaClassName() string {
return "org.apache.dubbo.User"
}
diff --git
a/registry/zookeeper/go-server/tests/integration/userprovider_test.go
b/registry/zookeeper/go-server/tests/integration/userprovider_test.go
new file mode 100644
index 0000000..7183e64
--- /dev/null
+++ b/registry/zookeeper/go-server/tests/integration/userprovider_test.go
@@ -0,0 +1,39 @@
+// +build integration
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package integration
+
+import (
+ "context"
+ "testing"
+)
+
+import (
+ "github.com/stretchr/testify/assert"
+)
+
+func TestGetUser(t *testing.T) {
+ user := &User{}
+ err := userProvider.GetUser(context.TODO(), []interface{}{"A001"}, user)
+ assert.Nil(t, err)
+ assert.Equal(t, "A001", user.ID)
+ assert.Equal(t, "Alex Stocks", user.Name)
+ assert.Equal(t, int32(18), user.Age)
+ assert.NotNil(t, user.Time)
+}
diff --git a/start_integrate_test.sh b/start_integrate_test.sh
index 1151c43..b204df0 100755
--- a/start_integrate_test.sh
+++ b/start_integrate_test.sh
@@ -30,8 +30,9 @@ array+=("filter/custom/go-server")
array+=("filter/tpslimit/go-server")
array+=("filter/sentinel/go-server")
-# todo generic temporarily has bugs
-#array+=("generic/go-server")
+array+=("general/dubbo/go-server")
+
+array+=("generic/go-server")
# hello world
array+=("helloworld/go-server")
@@ -40,12 +41,12 @@ array+=("helloworld/go-server")
array+=("metric/go-server")
# multi-registry
-#array+=("multi-registry/go-server")
+# array+=("multi-registry/go-server")
+
+array+=("registry/zookeeper/go-server")
# registry/servicediscovery/zookeeper
array+=("registry/servicediscovery/zookeeper/go-server")
-# registry/servicediscovery/consul
-#array+=("registry/servicediscovery/consul/go-server")
for((i=0;i<${#array[*]};i++))