You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/06/11 09:56:18 UTC

[dubbo-go-samples] branch master updated: chore: rm apollo integration test (#385)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 230711eb chore: rm apollo integration test (#385)
230711eb is described below

commit 230711ebd638beed2fe11a9c3a1a3234d7642941
Author: MasterKenway <40...@users.noreply.github.com>
AuthorDate: Sat Jun 11 17:56:14 2022 +0800

    chore: rm apollo integration test (#385)
---
 .../configcenter-apollo-client.run.xml             | 14 ----
 .../configcenter-apollo-server.run.xml             | 14 ----
 README.md                                          |  2 +-
 README_zh.md                                       |  2 +-
 configcenter/apollo/README.md                      | 61 ----------------
 configcenter/apollo/README_zh.md                   | 56 ---------------
 configcenter/apollo/go-client/cmd/client.go        | 55 --------------
 configcenter/apollo/go-client/conf/dubbogo.yml     |  7 --
 configcenter/apollo/go-server/cmd/server.go        | 83 ----------------------
 configcenter/apollo/go-server/conf/dubbogo.yml     |  7 --
 10 files changed, 2 insertions(+), 299 deletions(-)

diff --git a/.run/configcenter/configcenter-apollo-client.run.xml b/.run/configcenter/configcenter-apollo-client.run.xml
deleted file mode 100644
index c104d205..00000000
--- a/.run/configcenter/configcenter-apollo-client.run.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="configcenter-apollo-client" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="configcenter" singleton="true">
-    <module name="dubbo-go-samples" />
-    <working_directory value="$PROJECT_DIR$/configcenter/apollo/go-client" />
-    <envs>
-      <env name="DUBBO_GO_CONFIG_PATH" value="$PROJECT_DIR$/configcenter/apollo/go-client/conf/dubbogo.yml" />
-    </envs>
-    <kind value="PACKAGE" />
-    <package value="github.com/apache/dubbo-go-samples/configcenter/apollo/go-client/cmd" />
-    <directory value="$PROJECT_DIR$" />
-    <filePath value="$PROJECT_DIR$/configcenter/apollo/go-client/cmd/client.go" />
-    <method v="2" />
-  </configuration>
-</component>
\ No newline at end of file
diff --git a/.run/configcenter/configcenter-apollo-server.run.xml b/.run/configcenter/configcenter-apollo-server.run.xml
deleted file mode 100644
index f7e42f6f..00000000
--- a/.run/configcenter/configcenter-apollo-server.run.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="configcenter-apollo-server" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="configcenter" singleton="true">
-    <module name="dubbo-go-samples" />
-    <working_directory value="$PROJECT_DIR$/configcenter/apollo/go-server" />
-    <envs>
-      <env name="DUBBO_GO_CONFIG_PATH" value="$PROJECT_DIR$/configcenter/apollo/go-server/conf/dubbogo.yml" />
-    </envs>
-    <kind value="PACKAGE" />
-    <package value="github.com/apache/dubbo-go-samples/configcenter/apollo/go-server/cmd" />
-    <directory value="$PROJECT_DIR$" />
-    <filePath value="$PROJECT_DIR$/configcenter/apollo/go-client/cmd/server.go" />
-    <method v="2" />
-  </configuration>
-</component>
\ No newline at end of file
diff --git a/README.md b/README.md
index 0e65acf9..d7979f31 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
 
 * async: An async example.
 * attachment: An attachment example, to show how to use attachment to pass user data from the client to the server.
-* configcenter: uses of different config centers, including zookeeper, apollo and nacos at present.
+* configcenter: uses of different config centers, including zookeeper and nacos at present.
 * direct: A direct invocation example.
 * filter: Some examples of different filter, including custom_filter and tpslimit
 * rpc: dubbo directory display dubbo protocol communication
diff --git a/README_zh.md b/README_zh.md
index f2185d51..ef705657 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -5,7 +5,7 @@
 ## 本工程包含的示例
 
 * config-api: 无需配置文件,使用 API 的方式启动服务、构造组件和使用。
-* configcenter: 使用不同的配置中心,目前支持:zookeeper、apollo、和 nacos
+* configcenter: 使用不同的配置中心,目前支持:zookeeper、和 nacos
 * context: 如何通过 go context  把用户数据 attachment 从调用方传递给服务方
 * direct: 直连模式,无需注册中心,直连服务提供者
 * rpc: 使用 Dubbogo 框架启动 rpc 服务,发起调用
diff --git a/configcenter/apollo/README.md b/configcenter/apollo/README.md
deleted file mode 100644
index 2a756eaf..00000000
--- a/configcenter/apollo/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Apollo config center example
-
-
-## Instructions
-
-
-### go-server start
-
-1. Create new apollo server namespace for yaml format
-
-2. Add provider config content 
-```yaml
-dubbo:
-  application:
-     name: demo-server
-     version: 2.0
-  registries:
-    demoZK:
-      protocol: zookeeper
-      timeout: 3s
-      address: 127.0.0.1:2181
-  protocols:
-    triple:
-      name: tri
-      port: 20000
-  provider:
-    services:
-      greeterImpl:
-        interface: "com.apache.dubbo.sample.basic.IGreeter" # must be compatible with grpc or dubbo-java
-```
-
-3. Start provider server
-
-### go-client start
-
-1. Create new apollo client namespace for yaml format
-
-2. Add client config content
-
-```yaml
-dubbo:
-  registries:
-    "demoZK":
-      protocol: "zookeeper"
-      timeout: "3s"
-      address: "127.0.0.1:2181"
-  consumer:
-    registry-ids:
-      - demoZK
-    references:
-      "greeterImpl":
-        protocol: "tri"
-        interface: "com.apache.dubbo.sample.basic.IGreeter" # must be compatible with grpc or dubbo-java
-```
-
-3. Start provider server
-
-
-
- 
-
diff --git a/configcenter/apollo/README_zh.md b/configcenter/apollo/README_zh.md
deleted file mode 100644
index cdbedead..00000000
--- a/configcenter/apollo/README_zh.md
+++ /dev/null
@@ -1,56 +0,0 @@
-# Apollo 配置中心示例
-
-
-## 介绍
-
-
-### go-server 启动
-
-1. 创建新的apollo服务端yaml格式的namespace
-
-2. 添加服务端配置内容
-
-```yaml
-dubbo:
-  application:
-     name: demo-server
-     version: 2.0"
-  registries:
-    demoZK:
-      protocol: zookeeper
-      address: 127.0.0.1:2181
-  protocols:
-    triple:
-      name: tri
-      port: 20000
-  provider:
-    services:
-      greeterImpl:
-        interface: com.apache.dubbo.sample.basic.IGreeter # must be compatible with grpc or dubbo-java
-```
-
-3. 启动go-server
-
-### go-client 启动
-
-1. 创建新的apollo客户端yaml格式的namespace
-
-2. 添加客户端配置内容
-
-```yaml
-dubbo:
-  registries:
-    "demoZK":
-      protocol: "zookeeper"
-      timeout: "3s"
-      address: "127.0.0.1:2181"
-  consumer:
-    registry-ids:
-      - demoZK
-    references:
-      "greeterImpl":
-        protocol: "tri"
-        interface: "com.apache.dubbo.sample.basic.IGreeter" # must be compatible with grpc or dubbo-java
-```
-
-3. 启动go-client
\ No newline at end of file
diff --git a/configcenter/apollo/go-client/cmd/client.go b/configcenter/apollo/go-client/cmd/client.go
deleted file mode 100644
index 54a69c14..00000000
--- a/configcenter/apollo/go-client/cmd/client.go
+++ /dev/null
@@ -1,55 +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/common/logger"
-	"dubbo.apache.org/dubbo-go/v3/config"
-	_ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
-	"github.com/apache/dubbo-go-samples/api"
-)
-
-var grpcGreeterImpl = new(api.GreeterClientImpl)
-
-func init() {
-	config.SetConsumerService(grpcGreeterImpl)
-}
-
-// export DUBBO_GO_CONFIG_PATH= PATH_TO_SAMPLES/helloworld/go-client/conf/dubbogo.yml
-func main() {
-	if err := config.Load(); 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/configcenter/apollo/go-client/conf/dubbogo.yml b/configcenter/apollo/go-client/conf/dubbogo.yml
deleted file mode 100644
index c147f2e2..00000000
--- a/configcenter/apollo/go-client/conf/dubbogo.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-dubbo:
-  config-center:
-    protocol: "apollo"
-    address: "localhost:8080"
-    app-id: "demo_server"
-    cluster: "default"
-    namespace: "demo-client-config"
diff --git a/configcenter/apollo/go-server/cmd/server.go b/configcenter/apollo/go-server/cmd/server.go
deleted file mode 100644
index fb212cbf..00000000
--- a/configcenter/apollo/go-server/cmd/server.go
+++ /dev/null
@@ -1,83 +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"
-	"os"
-	"os/signal"
-	"syscall"
-	"time"
-)
-
-import (
-	"dubbo.apache.org/dubbo-go/v3/common/logger"
-	"dubbo.apache.org/dubbo-go/v3/config"
-	_ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
-	"github.com/apache/dubbo-go-samples/api"
-)
-
-var (
-	survivalTimeout = int(3e9)
-)
-
-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 main() {
-	config.SetProviderService(&GreeterProvider{})
-	err := config.Load()
-	if err != nil {
-		panic(err)
-	}
-	initSignal()
-}
-
-func initSignal() {
-	signals := make(chan os.Signal, 1)
-	// It is not possible to block SIGKILL or syscall.SIGSTOP
-	signal.Notify(signals, os.Interrupt, 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)
-			})
-
-			// The program exits normally or timeout forcibly exits.
-			fmt.Println("provider app exit now...")
-			return
-		}
-	}
-}
diff --git a/configcenter/apollo/go-server/conf/dubbogo.yml b/configcenter/apollo/go-server/conf/dubbogo.yml
deleted file mode 100644
index 0b09dabe..00000000
--- a/configcenter/apollo/go-server/conf/dubbogo.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-dubbo:
-  config-center:
-    protocol: "apollo"
-    address: "localhost:8080"
-    app-id: "demo_server"
-    cluster: "default"
-    namespace: "demo-provider-config"