This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
The following commit(s) were added to refs/heads/main by this push:
new f4404e16 chore: remove compatibility/config-api (#1018)
f4404e16 is described below
commit f4404e1622ce97d85a632c6738c70b91aa9f9145
Author: zbchi <[email protected]>
AuthorDate: Tue Jan 13 19:11:15 2026 +0800
chore: remove compatibility/config-api (#1018)
---
README.md | 1 -
README_CN.md | 1 -
compatibility/config-api/README.md | 18 -----
.../config-merge/go-client/cmd/client.go | 57 --------------
.../config-merge/go-client/conf/dubbogo-local.yml | 14 ----
.../config-merge/go-client/conf/dubbogo.yml | 13 ----
.../config-merge/go-server/cmd/server.go | 88 ---------------------
.../config-merge/go-server/conf/dubbogo.yml | 13 ----
.../configcenter/nacos/go-client/cmd/client.go | 87 ---------------------
.../configcenter/nacos/go-server/cmd/server.go | 89 ----------------------
.../configcenter/zookeeper/go-client/cmd/client.go | 85 ---------------------
.../configcenter/zookeeper/go-server/cmd/server.go | 86 ---------------------
compatibility/config-api/rpc/README.md | 69 -----------------
.../config-api/rpc/triple/go-client/cmd/client.go | 63 ---------------
.../config-api/rpc/triple/go-server/cmd/server.go | 65 ----------------
.../config-api/subModule/configcenter/main.go | 26 -------
.../config-api/subModule/registry/README.md | 35 ---------
.../config-api/subModule/registry/main.go | 54 -------------
compatibility/config-api/subModule/service/main.go | 26 -------
.../config-merge/tests/integration/main_test.go | 41 ----------
.../config-merge/tests/integration/merge_test.go | 41 ----------
.../integration/config-api-center-nacos_test.go | 46 -----------
.../nacos/tests/integration/main_test.go | 80 -------------------
.../tests/integration/config-api-center-zk_test.go | 46 -----------
.../zookeeper/tests/integration/main_test.go | 80 -------------------
.../tests/integration/configapi_rpc_triple_test.go | 45 -----------
.../rpc/triple/tests/integration/main_test.go | 52 -------------
start_integrate_test.sh | 6 --
28 files changed, 1327 deletions(-)
diff --git a/README.md b/README.md
index 10f9f08f..d7fa3f69 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,6 @@ A collection of runnable Dubbo-go examples covering
configuration, registries, o
### compatibility (legacy Dubbo-go samples)
* `compatibility/apisix`: Example integrating Apache APISIX with Dubbo-go.
-* `compatibility/config-api`: Shows how to use Dubbo-go via APIs without
configuration files.
* `compatibility/generic`: Generic invocation example.
* `compatibility/mesh`: Proxy-based service mesh example showing how to deploy
Dubbo-go services with Envoy on Kubernetes.
* `compatibility/polaris`: Dubbo-go integrate with polaris samples.
diff --git a/README_CN.md b/README_CN.md
index c0ee9829..3a1e7307 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -49,7 +49,6 @@
### compatibility(旧版 Dubbo-go 示例)
* `compatibility/apisix`:Dubbo-go 集成 Apache APISIX 的示例。
-* `compatibility/config-api`:演示如何在不使用配置文件的情况下,通过 API 使用 Dubbo-go。
* `compatibility/generic`:泛化调用示例。
* `compatibility/mesh`:基于代理的服务网格示例,展示如何在 Kubernetes 上结合 Envoy 部署 Dubbo-go 服务。
* `compatibility/polaris`: Dubbo-go 与 polaris 集成示例.
diff --git a/compatibility/config-api/README.md
b/compatibility/config-api/README.md
deleted file mode 100644
index 1da9b52b..00000000
--- a/compatibility/config-api/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-## 配置API
-
-配置API旨在支持用户通过API的形式来使用dubbo-go框架,而无需定义配置文件。
-配置API具有更高的灵活性,可以在代码中动态地写入配置条目,从而启动框架服务,或者生成自己需要使用的实例。例如注册中心、配置中心等模块。
-
-### 目录结构
-
--configcenter/
-
-使用配置API,从远程配置中心读取框架启动配置,详情见 [README](rpc/README.md)
-
-- rpc/
-
-使用配置API启动provider端和consumer端,发起调用
-
-- subModule/
-
-使用配置API 获取框架特定组件的实例
diff --git a/compatibility/config-api/config-merge/go-client/cmd/client.go
b/compatibility/config-api/config-merge/go-client/cmd/client.go
deleted file mode 100644
index 110467ac..00000000
--- a/compatibility/config-api/config-merge/go-client/cmd/client.go
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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 main
-
-import (
- "context"
- "fmt"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-
- "github.com/dubbogo/gost/log/logger"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-var grpcGreeterImpl = new(api.GreeterClientImpl)
-
-// export DUBBO_GO_CONFIG_PATH=
PATH_TO_SAMPLES/helloworld/go-client/conf/dubbogo.yml
-func main() {
- config.SetConsumerService(grpcGreeterImpl)
- if err := config.Load(); err != nil {
- panic(err)
- }
- registries := config.GetRootConfig().Registries
- fmt.Printf("\n!start test config-merge:\n")
- fmt.Printf("registries[\"demoZK\"]: %v\n", registries["demoZK"])
- fmt.Printf("config.GetDefineValue(\"test-config\", false): %v\n\n",
config.GetDefineValue("test-config", false))
- logger.Info("start to test dubbo")
- req := &api.HelloRequest{
- Name: "laurence",
- }
- reply, err := grpcGreeterImpl.SayHello(context.Background(), req)
- if err != nil {
- logger.Error(err)
- }
- logger.Infof("client response result: %v\n", reply)
-}
diff --git
a/compatibility/config-api/config-merge/go-client/conf/dubbogo-local.yml
b/compatibility/config-api/config-merge/go-client/conf/dubbogo-local.yml
deleted file mode 100644
index f70804e7..00000000
--- a/compatibility/config-api/config-merge/go-client/conf/dubbogo-local.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-dubbo:
- custom:
- config-map:
- test-config: true
- registries:
- demoZK:
- protocol: zookeeper
- timeout: 10s
- address: 127.0.0.1:2181
- consumer:
- references:
- GreeterClientImpl:
- protocol: tri
- interface: com.apache.dubbo.sample.basic.IGreeter # must be compatible
with grpc or dubbo-java
\ No newline at end of file
diff --git a/compatibility/config-api/config-merge/go-client/conf/dubbogo.yml
b/compatibility/config-api/config-merge/go-client/conf/dubbogo.yml
deleted file mode 100644
index a3af6714..00000000
--- a/compatibility/config-api/config-merge/go-client/conf/dubbogo.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-dubbo:
- profiles:
- active: local
- registries:
- demoZK:
- protocol: zookeeper
- timeout: 3s
- address: 127.0.0.1:2181
- consumer:
- references:
- GreeterClientImpl:
- protocol: tri
- interface: com.apache.dubbo.sample.basic.IGreeter # must be compatible
with grpc or dubbo-java
\ No newline at end of file
diff --git a/compatibility/config-api/config-merge/go-server/cmd/server.go
b/compatibility/config-api/config-merge/go-server/cmd/server.go
deleted file mode 100644
index 0b94e048..00000000
--- a/compatibility/config-api/config-merge/go-server/cmd/server.go
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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 main
-
-import (
- "context"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-
- "github.com/dubbogo/gost/log/logger"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-type GreeterProvider struct {
- api.UnimplementedGreeterServer
-}
-
-func (s *GreeterProvider) SayHello(ctx context.Context, in *api.HelloRequest)
(*api.User, error) {
- logger.Infof("Dubbo3 GreeterProvider get user name = %s\n", in.Name)
- return &api.User{Name: "Hello " + in.Name, Id: "12345", Age: 21}, nil
-}
-
-func (s *GreeterProvider) SayHelloStream(svr api.Greeter_SayHelloStreamServer)
error {
- c, err := svr.Recv()
- if err != nil {
- return err
- }
- logger.Infof("Dubbo-go3 GreeterProvider recv 1 user, name = %s\n",
c.Name)
- c2, err := svr.Recv()
- if err != nil {
- return err
- }
- logger.Infof("Dubbo-go3 GreeterProvider recv 2 user, name = %s\n",
c2.Name)
-
- err = svr.Send(&api.User{
- Name: "hello " + c.Name,
- Age: 18,
- Id: "123456789",
- })
- if err != nil {
- return err
- }
- c3, err := svr.Recv()
- if err != nil {
- return err
- }
- logger.Infof("Dubbo-go3 GreeterProvider recv 3 user, name = %s\n",
c3.Name)
-
- err = svr.Send(&api.User{
- Name: "hello " + c2.Name,
- Age: 19,
- Id: "123456789",
- })
- if err != nil {
- return err
- }
- return nil
-}
-
-// export DUBBO_GO_CONFIG_PATH=
PATH_TO_SAMPLES/helloworld/go-server/conf/dubbogo.yml
-func main() {
- config.SetProviderService(&GreeterProvider{})
- if err := config.Load(); err != nil {
- panic(err)
- }
- select {}
-}
diff --git a/compatibility/config-api/config-merge/go-server/conf/dubbogo.yml
b/compatibility/config-api/config-merge/go-server/conf/dubbogo.yml
deleted file mode 100644
index 1f1bb4a9..00000000
--- a/compatibility/config-api/config-merge/go-server/conf/dubbogo.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-dubbo:
- registries:
- demoZK:
- protocol: zookeeper
- address: 127.0.0.1:2181
- protocols:
- triple:
- name: tri
- port: 20000
- provider:
- services:
- GreeterProvider:
- interface: com.apache.dubbo.sample.basic.IGreeter # must be compatible
with grpc or dubbo-java
\ No newline at end of file
diff --git
a/compatibility/config-api/configcenter/nacos/go-client/cmd/client.go
b/compatibility/config-api/configcenter/nacos/go-client/cmd/client.go
deleted file mode 100644
index bf957ba0..00000000
--- a/compatibility/config-api/configcenter/nacos/go-client/cmd/client.go
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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 main
-
-import (
- "context"
- "time"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-
- "github.com/dubbogo/gost/log/logger"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-const configCenterNacosClientConfig = `## set in config center, group is
'dubbo', dataid is 'dubbo-go-samples-configcenter-nacos-client', namespace is
default
-dubbo:
- registries:
- demoZK:
- protocol: zookeeper
- address: 127.0.0.1:2181
- consumer:
- references:
- GreeterClientImpl:
- protocol: tri
-`
-
-var grpcGreeterImpl = new(api.GreeterClientImpl)
-
-// There is no need to export DUBBO_GO_CONFIG_PATH, as you are using config
api to set config
-func main() {
- dynamicConfig, err := config.NewConfigCenterConfigBuilder().
- SetProtocol("nacos").
- SetAddress("127.0.0.1:8848").
- Build().GetDynamicConfiguration()
- if err != nil {
- panic(err)
- }
- if err =
dynamicConfig.PublishConfig("dubbo-go-samples-configcenter-nacos-client",
"dubbo", configCenterNacosClientConfig); err != nil {
- panic(err)
- }
-
- time.Sleep(10 * time.Second)
-
- config.SetConsumerService(grpcGreeterImpl)
-
- rootConfig := config.NewRootConfigBuilder().
- SetConfigCenter(config.NewConfigCenterConfigBuilder().
- SetProtocol("nacos").SetAddress("127.0.0.1:8848").
-
SetDataID("dubbo-go-samples-configcenter-nacos-client").SetGroup("dubbo").
- Build()).
- Build()
-
- if err = config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
-
- logger.Info("start to test dubbo")
- req := &api.HelloRequest{
- Name: "laurence",
- }
- reply, err := grpcGreeterImpl.SayHello(context.Background(), req)
- if err != nil {
- logger.Error(err)
- }
- logger.Infof("client response result: %v\n", reply)
-}
diff --git
a/compatibility/config-api/configcenter/nacos/go-server/cmd/server.go
b/compatibility/config-api/configcenter/nacos/go-server/cmd/server.go
deleted file mode 100644
index ffdad120..00000000
--- a/compatibility/config-api/configcenter/nacos/go-server/cmd/server.go
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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 main
-
-import (
- "context"
- "time"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-
- "github.com/dubbogo/gost/log/logger"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-const configCenterNacosServerConfig = `# set in config center, group is
'dubbo', dataid is 'dubbo-go-samples-configcenter-nacos-server', namespace is
default
-dubbo:
- registries:
- demoZK:
- protocol: zookeeper
- address: 127.0.0.1:2181
- protocols:
- triple:
- name: tri
- port: 20000
- provider:
- services:
- GreeterProvider:
- interface: "" # read interface from pb`
-
-type GreeterProvider struct {
- api.UnimplementedGreeterServer
-}
-
-func (s *GreeterProvider) SayHello(ctx context.Context, in *api.HelloRequest)
(*api.User, error) {
- logger.Infof("Dubbo3 GreeterProvider get user name = %s\n", in.Name)
- return &api.User{Name: "Hello " + in.Name, Id: "12345", Age: 21}, nil
-}
-
-// There is no need to export DUBBO_GO_CONFIG_PATH, as you are using config
api to set config
-func main() {
- dynamicConfig, err := config.NewConfigCenterConfigBuilder().
- SetProtocol("nacos").
- SetAddress("127.0.0.1:8848").
- Build().GetDynamicConfiguration()
-
- if err != nil {
- panic(err)
- }
-
- if err :=
dynamicConfig.PublishConfig("dubbo-go-samples-configcenter-nacos-server",
"dubbo", configCenterNacosServerConfig); err != nil {
- panic(err)
- }
- time.Sleep(time.Second * 10)
-
- config.SetProviderService(&GreeterProvider{})
-
- rootConfig := config.NewRootConfigBuilder().
- SetConfigCenter(config.NewConfigCenterConfigBuilder().
- SetProtocol("nacos").SetAddress("127.0.0.1:8848").
-
SetDataID("dubbo-go-samples-configcenter-nacos-server").SetGroup("dubbo").
- Build()).
- Build()
-
- if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
- select {}
-}
diff --git
a/compatibility/config-api/configcenter/zookeeper/go-client/cmd/client.go
b/compatibility/config-api/configcenter/zookeeper/go-client/cmd/client.go
deleted file mode 100644
index cf989055..00000000
--- a/compatibility/config-api/configcenter/zookeeper/go-client/cmd/client.go
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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 main
-
-import (
- "context"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-
- "github.com/dubbogo/gost/log/logger"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-const configCenterZKClientConfig = `## set in config center, group is
'dubbogo', dataid is 'dubbo-go-samples-configcenter-zookeeper-client',
namespace is default
-dubbo:
- registries:
- demoZK:
- protocol: zookeeper
- address: 127.0.0.1:2181
- consumer:
- references:
- GreeterClientImpl:
- protocol: tri
-`
-
-var grpcGreeterImpl = new(api.GreeterClientImpl)
-
-// There is no need to export DUBBO_GO_CONFIG_PATH, as you are using config
api to set config
-func main() {
- dynamicConfig, err := config.NewConfigCenterConfigBuilder().
- SetProtocol("zookeeper").
- SetAddress("127.0.0.1:2181").
- Build().GetDynamicConfiguration()
- if err != nil {
- panic(err)
- }
-
- if err =
dynamicConfig.PublishConfig("dubbo-go-samples-configcenter-zookeeper-client",
"dubbogo", configCenterZKClientConfig); err != nil {
- panic(err)
- }
-
- config.SetConsumerService(grpcGreeterImpl)
-
- rootConfig := config.NewRootConfigBuilder().
- SetConfigCenter(config.NewConfigCenterConfigBuilder().
- SetProtocol("zookeeper").SetAddress("127.0.0.1:2181").
-
SetDataID("dubbo-go-samples-configcenter-zookeeper-client").
- SetGroup("dubbogo").
- Build()).
- Build()
-
- if err = config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
- logger.Info("start to test dubbo")
- req := &api.HelloRequest{
- Name: "laurence",
- }
- reply, err := grpcGreeterImpl.SayHello(context.Background(), req)
- if err != nil {
- logger.Error(err)
- }
- logger.Infof("client response result: %v\n", reply)
-}
diff --git
a/compatibility/config-api/configcenter/zookeeper/go-server/cmd/server.go
b/compatibility/config-api/configcenter/zookeeper/go-server/cmd/server.go
deleted file mode 100644
index 6b979153..00000000
--- a/compatibility/config-api/configcenter/zookeeper/go-server/cmd/server.go
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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 main
-
-import (
- "context"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-
- "github.com/dubbogo/gost/log/logger"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-const configCenterZKServerConfig = `# set in config center, group is
'dubbogo', dataid is 'dubbo-go-samples-configcenter-zookeeper-server',
namespace is default
-dubbo:
- registries:
- demoZK:
- protocol: zookeeper
- address: 127.0.0.1:2181
- protocols:
- triple:
- name: tri
- port: 20000
- provider:
- services:
- GreeterProvider:
- interface: "" # read interface from pb`
-
-type GreeterProvider struct {
- api.UnimplementedGreeterServer
-}
-
-func (s *GreeterProvider) SayHello(ctx context.Context, in *api.HelloRequest)
(*api.User, error) {
- logger.Infof("Dubbo3 GreeterProvider get user name = %s\n", in.Name)
- return &api.User{Name: "Hello " + in.Name, Id: "12345", Age: 21}, nil
-}
-
-// There is no need to export DUBBO_GO_CONFIG_PATH, as you are using config
api to set config
-func main() {
- dynamicConfig, err := config.NewConfigCenterConfigBuilder().
- SetProtocol("zookeeper").
- SetAddress("127.0.0.1:2181").
- Build().GetDynamicConfiguration()
- if err != nil {
- panic(err)
- }
- if err :=
dynamicConfig.PublishConfig("dubbo-go-samples-configcenter-zookeeper-server",
"dubbogo", configCenterZKServerConfig); err != nil {
- panic(err)
- }
-
- config.SetProviderService(&GreeterProvider{})
-
- rootConfig := config.NewRootConfigBuilder().
- SetConfigCenter(config.NewConfigCenterConfigBuilder().
- SetProtocol("zookeeper").SetAddress("127.0.0.1:2181").
-
SetDataID("dubbo-go-samples-configcenter-zookeeper-server").
- SetGroup("dubbogo").
- Build()).
- Build()
-
- if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
- select {}
-}
diff --git a/compatibility/config-api/rpc/README.md
b/compatibility/config-api/rpc/README.md
deleted file mode 100644
index d8963a1f..00000000
--- a/compatibility/config-api/rpc/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Dubbogo 使用api进行配置初始化
-
-### 使用方法
-- 服务端:
- triple/go-server/cmd/server.go
-
-```go
-// 注册Provider,通过结构名,或者 Reference()函数返回值'greeterImpl',与 provider配置serviceKey相对应
-config.SetProviderService(&GreeterProvider{})
-
-// 生成service配置
-serviceConfig := config.NewServiceConfig(
- config.WithServiceInterface("com.apache.dubbo.sample.basic.IGreeter"), //
接口名,consuemr与provider对应的ID
- config.WithServiceProtocolKeys("tripleKey"), // 选择的协议key,与rootConfig
声明的支持协议key需要对应
-)
-
-// 生成协议配置
-protocolConfig := config.NewProtocolConfig(
- config.WithProtocolName("tri"),
- config.WithProtocolPort("20000"),
-)
-
-// 生成provider配置
-providerConfig := config.NewProviderConfig(
- config.WithProviderRegistryKeys("zk"), // provider 选择使用的注册中心key
- config.WithProviderService("greeterImpl", serviceConfig), // provider 注册
serviceKey 和用上面定义好的 GreeterProvider
-)
-
-// 生成注册中心配置
-registryConfig := config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")
-
-// 生成根配置
-rootConfig := config.NewRootConfig(
- config.WithRootProviderConfig(providerConfig), // 使用provider配置
- config.WithRootRegistryConfig("zk", registryConfig), // 声明注册中心Key和注册中心配置
- config.WithRootProtocolConfig("tripleKey", protocolConfig),//
声明当前应用支持的协议key,与 serviceConfig 选择的协议key需要对应
-)
-
-// 服务启动
-if err := config.Load(config.WithRootConfig(rootConfig)); err != nil{
- panic(err)
-}
-select {}
-```
-- 客户端,与provider端类似
-```go
-config.SetConsumerService(tripleGreeterImpl)
-
-referenceConfig := config.NewReferenceConfig(
- config.WithReferenceInterface("com.apache.dubbo.sample.basic.IGreeter"),
- config.WithReferenceProtocolName("tri"),
- config.WithReferenceRegistry("zkRegistryKey"),
-)
-
-consumerConfig := config.NewConsumerConfig(
- config.WithConsumerReferenceConfig("greeterImpl", referenceConfig),
-)
-
-registryConfig := config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")
-
-rootConfig := config.NewRootConfig(
- config.WithRootRegistryConfig("zkRegistryKey", registryConfig),
- config.WithRootConsumerConfig(consumerConfig),
-)
-
-if err := config.Load(config.WithRootConfig(rootConfig)); err != nil{
- panic(err)
-}
-```
\ No newline at end of file
diff --git a/compatibility/config-api/rpc/triple/go-client/cmd/client.go
b/compatibility/config-api/rpc/triple/go-client/cmd/client.go
deleted file mode 100644
index 392ab883..00000000
--- a/compatibility/config-api/rpc/triple/go-client/cmd/client.go
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 main
-
-import (
- "context"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-
- "github.com/dubbogo/gost/log/logger"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-var tripleGreeterImpl = new(api.GreeterClientImpl)
-
-// There is no need to export DUBBO_GO_CONFIG_PATH, as you are using config
api to set config
-func main() {
- config.SetConsumerService(tripleGreeterImpl)
-
- rootConfig := config.NewRootConfigBuilder().
- SetConsumer(config.NewConsumerConfigBuilder().
- AddReference("GreeterClientImpl",
config.NewReferenceConfigBuilder().
- SetProtocol("tri").
- Build()).
- Build()).
- AddRegistry("zkRegistryKey",
config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")).
- Build()
-
- if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
-
- logger.Info("start to test dubbo")
- req := &api.HelloRequest{
- Name: "laurence",
- }
- reply, err := tripleGreeterImpl.SayHello(context.Background(), req)
- if err != nil {
- logger.Error(err)
- }
- logger.Infof("client response result: %v\n", reply)
-}
diff --git a/compatibility/config-api/rpc/triple/go-server/cmd/server.go
b/compatibility/config-api/rpc/triple/go-server/cmd/server.go
deleted file mode 100644
index 90179121..00000000
--- a/compatibility/config-api/rpc/triple/go-server/cmd/server.go
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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 main
-
-import (
- "context"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-
- "github.com/dubbogo/gost/log/logger"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-type GreeterProvider struct {
- api.UnimplementedGreeterServer
-}
-
-func (s *GreeterProvider) SayHello(ctx context.Context, in *api.HelloRequest)
(*api.User, error) {
- logger.Infof("Dubbo3 GreeterProvider get user name = %s\n", in.Name)
- return &api.User{Name: "Hello " + in.Name, Id: "12345", Age: 21}, nil
-}
-
-// There is no need to export DUBBO_GO_CONFIG_PATH, as you are using config
api to set config
-func main() {
- config.SetProviderService(&GreeterProvider{})
-
- rootConfig := config.NewRootConfigBuilder().
- SetProvider(config.NewProviderConfigBuilder().
- AddService("GreeterProvider",
config.NewServiceConfigBuilder().
- Build()).
- Build()).
- AddRegistry("zk",
config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")).
- AddProtocol("tripleKey", config.NewProtocolConfigBuilder().
- SetName("tri").
- SetPort("20000").
- Build()).
- Build()
-
- if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
-
- select {}
-}
diff --git a/compatibility/config-api/subModule/configcenter/main.go
b/compatibility/config-api/subModule/configcenter/main.go
deleted file mode 100644
index e95a56ac..00000000
--- a/compatibility/config-api/subModule/configcenter/main.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 main
-
-import (
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-// todo
-func main() {
-}
diff --git a/compatibility/config-api/subModule/registry/README.md
b/compatibility/config-api/subModule/registry/README.md
deleted file mode 100644
index f67193e3..00000000
--- a/compatibility/config-api/subModule/registry/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-## 通过配置API生成实例化子模块
-
-### 注册中心
-
-例子:
-```go
-// 通过配置 API 生成注册中心配置,此处为默认zk配置
-registryConfig := config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")
-
-// 调用注册中心配置API,获取注册中心实例 reg
-reg, err := registryConfig.GetInstance(common.PROVIDER)
-if err != nil {
- panic(err)
-}
-
-// 生成一个 provider URL
-ivkURL, err := common.NewURL("mock://localhost:8080",
- common.WithPath("com.alibaba.dubbogo.HelloService"),
- common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)),
- common.WithMethods([]string{"GetUser", "SayHello"}),
-)
-if err != nil {
- panic(err)
-}
-// 使用新生成的注册中心实例注册
-if err := reg.Register(ivkURL); err != nil {
- panic(err)
-}
-time.Sleep(time.Second * 30)
-// 反注册
-if err := reg.UnRegister(ivkURL); err != nil {
- panic(err)
-}
-
-```
\ No newline at end of file
diff --git a/compatibility/config-api/subModule/registry/main.go
b/compatibility/config-api/subModule/registry/main.go
deleted file mode 100644
index e48debd2..00000000
--- a/compatibility/config-api/subModule/registry/main.go
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 main
-
-import (
- "strconv"
- "time"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/common"
- "dubbo.apache.org/dubbo-go/v3/common/constant"
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-func main() {
- registryConfig :=
config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")
- reg, err := registryConfig.GetInstance(common.PROVIDER)
- if err != nil {
- panic(err)
- }
-
- ivkURL, err := common.NewURL("mock://localhost:8080",
- common.WithPath("com.alibaba.dubbogo.HelloService"),
- common.WithParamsValue(constant.RegistryRoleKey,
strconv.Itoa(common.PROVIDER)),
- common.WithMethods([]string{"GetUser", "SayHello"}),
- )
- if err != nil {
- panic(err)
- }
- if err := reg.Register(ivkURL); err != nil {
- panic(err)
- }
- time.Sleep(time.Second * 30)
- if err := reg.UnRegister(ivkURL); err != nil {
- panic(err)
- }
-}
diff --git a/compatibility/config-api/subModule/service/main.go
b/compatibility/config-api/subModule/service/main.go
deleted file mode 100644
index e95a56ac..00000000
--- a/compatibility/config-api/subModule/service/main.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 main
-
-import (
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-// todo
-func main() {
-}
diff --git
a/integrate_test/compatibility/config-api/config-merge/tests/integration/main_test.go
b/integrate_test/compatibility/config-api/config-merge/tests/integration/main_test.go
deleted file mode 100644
index c4387073..00000000
---
a/integrate_test/compatibility/config-api/config-merge/tests/integration/main_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 (
- "testing"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-var userProvider = &api.GreeterClientImpl{}
-
-func TestMain(m *testing.M) {
- config.SetConsumerService(userProvider)
- err := config.Load()
- if err != nil {
- panic(err)
- }
-}
diff --git
a/integrate_test/compatibility/config-api/config-merge/tests/integration/merge_test.go
b/integrate_test/compatibility/config-api/config-merge/tests/integration/merge_test.go
deleted file mode 100644
index 97663715..00000000
---
a/integrate_test/compatibility/config-api/config-merge/tests/integration/merge_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-func TestToken(t *testing.T) {
- user, err := userProvider.SayHello(context.TODO(),
&api.HelloRequest{Name: "dubbo-go"})
-
- assert.Nil(t, err)
- assert.Equal(t, "Hello dubbo-go", user.Name)
- assert.Equal(t, "12345", user.Id)
- assert.Equal(t, 21, user.Age)
-
-}
diff --git
a/integrate_test/compatibility/config-api/configcenter/nacos/tests/integration/config-api-center-nacos_test.go
b/integrate_test/compatibility/config-api/configcenter/nacos/tests/integration/config-api-center-nacos_test.go
deleted file mode 100644
index d86c1c52..00000000
---
a/integrate_test/compatibility/config-api/configcenter/nacos/tests/integration/config-api-center-nacos_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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"
-)
-
-import (
- dubbo3pb "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-func TestSayHello(t *testing.T) {
- req := &dubbo3pb.HelloRequest{
- Name: "laurence",
- }
-
- ctx := context.Background()
-
- reply, err := greeterProvider.SayHello(ctx, req)
-
- assert.Nil(t, err)
- assert.Equal(t, "Hello laurence", reply.Name)
- assert.Equal(t, "12345", reply.Id)
- assert.Equal(t, int32(21), reply.Age)
-}
diff --git
a/integrate_test/compatibility/config-api/configcenter/nacos/tests/integration/main_test.go
b/integrate_test/compatibility/config-api/configcenter/nacos/tests/integration/main_test.go
deleted file mode 100644
index c4ed1dd0..00000000
---
a/integrate_test/compatibility/config-api/configcenter/nacos/tests/integration/main_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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 (
- "os"
- "testing"
- "time"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
- dubbo3pb "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-const configCenterNacosTestClientConfig = `## set in config center, group is
'dubbo', dataid is 'dubbo-go-samples-configcenter-nacos-client', namespace is
default
-dubbo:
- registries:
- demoZK:
- protocol: zookeeper
- address: 127.0.0.1:2181
- consumer:
- references:
- GreeterClientImpl:
- protocol: tri
- interface: "" # read interface from pb`
-
-var greeterProvider = new(dubbo3pb.GreeterClientImpl)
-
-func TestMain(m *testing.M) {
- dynamicConfig, err := config.NewConfigCenterConfigBuilder().
- SetProtocol("nacos").
- SetAddress("127.0.0.1:8848").
- Build().GetDynamicConfiguration()
- if err != nil {
- panic(err)
- }
-
- if err :=
dynamicConfig.PublishConfig("dubbo-go-samples-configcenter-nacos-client",
"dubbo", configCenterNacosTestClientConfig); err != nil {
- panic(err)
- }
-
- config.SetConsumerService(greeterProvider)
-
- time.Sleep(time.Second * 20)
-
- rootConfig := config.NewRootConfigBuilder().
- SetConfigCenter(config.NewConfigCenterConfigBuilder().
- SetProtocol("nacos").SetAddress("127.0.0.1:8848").
- SetDataID("dubbo-go-samples-configcenter-nacos-client").
- SetGroup("dubbo").
- Build()).
- Build()
-
- if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
- time.Sleep(3 * time.Second)
-
- os.Exit(m.Run())
-}
diff --git
a/integrate_test/compatibility/config-api/configcenter/zookeeper/tests/integration/config-api-center-zk_test.go
b/integrate_test/compatibility/config-api/configcenter/zookeeper/tests/integration/config-api-center-zk_test.go
deleted file mode 100644
index d86c1c52..00000000
---
a/integrate_test/compatibility/config-api/configcenter/zookeeper/tests/integration/config-api-center-zk_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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"
-)
-
-import (
- dubbo3pb "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-func TestSayHello(t *testing.T) {
- req := &dubbo3pb.HelloRequest{
- Name: "laurence",
- }
-
- ctx := context.Background()
-
- reply, err := greeterProvider.SayHello(ctx, req)
-
- assert.Nil(t, err)
- assert.Equal(t, "Hello laurence", reply.Name)
- assert.Equal(t, "12345", reply.Id)
- assert.Equal(t, int32(21), reply.Age)
-}
diff --git
a/integrate_test/compatibility/config-api/configcenter/zookeeper/tests/integration/main_test.go
b/integrate_test/compatibility/config-api/configcenter/zookeeper/tests/integration/main_test.go
deleted file mode 100644
index 9f27024f..00000000
---
a/integrate_test/compatibility/config-api/configcenter/zookeeper/tests/integration/main_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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 (
- "os"
- "testing"
- "time"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
- dubbo3pb "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-const configCenterZKTestClientConfig = `## set in config center, group is
'dubbogo', dataid is 'dubbo-go-samples-configcenter-zookeeper-client',
namespace is default
-dubbo:
- registries:
- demoZK:
- protocol: zookeeper
- address: 127.0.0.1:2181
- consumer:
- references:
- GreeterClientImpl:
- protocol: tri
-`
-
-var greeterProvider = new(dubbo3pb.GreeterClientImpl)
-
-func TestMain(m *testing.M) {
- dynamicConfig, err := config.NewConfigCenterConfigBuilder().
- SetProtocol("zookeeper").
- SetAddress("127.0.0.1:2181").
- Build().GetDynamicConfiguration()
- if err != nil {
- panic(err)
- }
-
- if err :=
dynamicConfig.PublishConfig("dubbo-go-samples-configcenter-zookeeper-client",
"dubbogo", configCenterZKTestClientConfig); err != nil {
- panic(err)
- }
-
- config.SetConsumerService(greeterProvider)
- time.Sleep(time.Second * 15)
-
- rootConfig := config.NewRootConfigBuilder().
- SetConfigCenter(config.NewConfigCenterConfigBuilder().
- SetProtocol("zookeeper").SetAddress("127.0.0.1:2181").
-
SetDataID("dubbo-go-samples-configcenter-zookeeper-client").
- SetGroup("dubbogo").
- Build()).
- Build()
-
- if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
-
- time.Sleep(3 * time.Second)
-
- os.Exit(m.Run())
-}
diff --git
a/integrate_test/compatibility/config-api/rpc/triple/tests/integration/configapi_rpc_triple_test.go
b/integrate_test/compatibility/config-api/rpc/triple/tests/integration/configapi_rpc_triple_test.go
deleted file mode 100644
index 5a127785..00000000
---
a/integrate_test/compatibility/config-api/rpc/triple/tests/integration/configapi_rpc_triple_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-func TestSayHello(t *testing.T) {
- req := &api.HelloRequest{
- Name: "laurence",
- }
-
- ctx := context.Background()
- reply, err := greeterProvider.SayHello(ctx, req)
-
- assert.Nil(t, err)
- assert.Equal(t, "Hello laurence", reply.Name)
- assert.Equal(t, "12345", reply.Id)
- assert.Equal(t, int32(21), reply.Age)
-}
diff --git
a/integrate_test/compatibility/config-api/rpc/triple/tests/integration/main_test.go
b/integrate_test/compatibility/config-api/rpc/triple/tests/integration/main_test.go
deleted file mode 100644
index 818b0e6b..00000000
---
a/integrate_test/compatibility/config-api/rpc/triple/tests/integration/main_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 (
- "os"
- "testing"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/compatibility/api"
-)
-
-var greeterProvider = new(api.GreeterClientImpl)
-
-func TestMain(m *testing.M) {
- config.SetConsumerService(greeterProvider)
- rootConfig := config.NewRootConfigBuilder().
- SetConsumer(config.NewConsumerConfigBuilder().
- AddReference("GreeterClientImpl",
config.NewReferenceConfigBuilder().
- SetProtocol("tri").
- Build()).
- Build()).
- AddRegistry("zkRegistryKey",
config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")).
- Build()
-
- if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
- panic(err)
- }
- os.Exit(m.Run())
-
-}
diff --git a/start_integrate_test.sh b/start_integrate_test.sh
index 21393ad9..511d4981 100755
--- a/start_integrate_test.sh
+++ b/start_integrate_test.sh
@@ -22,12 +22,6 @@ array+=("helloworld")
#array+=("game/game")
#array+=("game/gate")
-# config-api
-array+=("compatibility/config-api/rpc/triple")
-#array+=("compatibility/config-api/configcenter/nacos")
-array+=("compatibility/config-api/configcenter/zookeeper")
-array+=("compatibility/config-api/config-merge")
-
# tracing
array+=("otel/tracing/stdout")
array+=("otel/tracing/otlp_http_exporter")