You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by la...@apache.org on 2021/09/24 05:46:05 UTC
[dubbo-go-samples] branch config-enhance updated: add dubbogo
tracing sample (#243)
This is an automated email from the ASF dual-hosted git repository.
laurence pushed a commit to branch config-enhance
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
The following commit(s) were added to refs/heads/config-enhance by this push:
new c8c2aac add dubbogo tracing sample (#243)
c8c2aac is described below
commit c8c2aac42e17f493732dbd206c1a6fece5858768
Author: luky116 <38...@users.noreply.github.com>
AuthorDate: Fri Sep 24 13:46:00 2021 +0800
add dubbogo tracing sample (#243)
* add dubbogo tracing sample
* reformat code
* delete java project
* reformat code
* Merge remote-tracking branch 'origin/config-enhance' into feature-grpcTracing
# Conflicts:
# go.sum
* fix .run file
Co-authored-by: liuyuecai <li...@qiyi.com>
---
.run/tracing-grpc-go-client.run.xml | 15 --
.run/tracing-grpc-go-server.run.xml | 15 --
.run/tracing-jsonrpc-go-client.run.xml | 15 --
.run/tracing-jsonrpc-go-server.run.xml | 15 --
.../dubbo}/tracing-dubbo-go-client.run.xml | 3 +-
.../dubbo}/tracing-dubbo-go-server.run.xml | 3 +-
go.mod | 1 +
go.sum | 3 +
tracing/README.md | 19 ++
tracing/README_zh.md | 19 ++
tracing/dubbo/go-client/assembly/bin/load.sh | 203 ------------------
.../dubbo/go-client/assembly/common/app.properties | 23 ---
tracing/dubbo/go-client/assembly/common/build.sh | 83 --------
tracing/dubbo/go-client/assembly/linux/dev.sh | 36 ----
tracing/dubbo/go-client/assembly/linux/release.sh | 35 ----
tracing/dubbo/go-client/assembly/linux/test.sh | 35 ----
tracing/dubbo/go-client/assembly/mac/dev.sh | 36 ----
tracing/dubbo/go-client/assembly/mac/release.sh | 34 ---
tracing/dubbo/go-client/assembly/mac/test.sh | 34 ---
tracing/dubbo/go-client/assembly/windows/dev.sh | 34 ---
.../dubbo/go-client/assembly/windows/release.sh | 34 ---
tracing/dubbo/go-client/assembly/windows/test.sh | 34 ---
tracing/dubbo/go-client/cmd/client.go | 69 +++----
tracing/dubbo/go-client/cmd/version.go | 22 --
tracing/dubbo/go-client/conf/client.yml | 61 ------
tracing/dubbo/go-client/conf/dubbogo.yml | 16 ++
tracing/dubbo/go-client/conf/log.yml | 28 ---
tracing/dubbo/go-client/docker/docker-compose.yml | 44 ++++
tracing/dubbo/go-client/pkg/user.go | 20 +-
tracing/dubbo/go-client/profiles/dev/client.yml | 63 ------
tracing/dubbo/go-client/profiles/dev/log.yml | 28 ---
.../dubbo/go-client/profiles/release/client.yml | 60 ------
tracing/dubbo/go-client/profiles/release/log.yml | 28 ---
tracing/dubbo/go-client/profiles/test/client.yml | 61 ------
tracing/dubbo/go-client/profiles/test/log.yml | 28 ---
tracing/dubbo/go-server/assembly/bin/load.sh | 151 --------------
.../dubbo/go-server/assembly/common/app.properties | 23 ---
tracing/dubbo/go-server/assembly/common/build.sh | 80 -------
tracing/dubbo/go-server/assembly/linux/dev.sh | 36 ----
tracing/dubbo/go-server/assembly/linux/release.sh | 36 ----
tracing/dubbo/go-server/assembly/linux/test.sh | 36 ----
tracing/dubbo/go-server/assembly/mac/dev.sh | 36 ----
tracing/dubbo/go-server/assembly/mac/release.sh | 36 ----
tracing/dubbo/go-server/assembly/mac/test.sh | 36 ----
tracing/dubbo/go-server/assembly/windows/dev.sh | 36 ----
.../dubbo/go-server/assembly/windows/release.sh | 36 ----
tracing/dubbo/go-server/assembly/windows/test.sh | 36 ----
tracing/dubbo/go-server/cmd/server.go | 58 +++---
tracing/dubbo/go-server/cmd/version.go | 22 --
tracing/dubbo/go-server/conf/client.yml | 61 ------
tracing/dubbo/go-server/conf/dubbogo.yml | 24 +++
tracing/dubbo/go-server/conf/log.yml | 28 ---
tracing/dubbo/go-server/conf/server.yml | 62 ------
tracing/dubbo/go-server/docker/docker-compose.yml | 36 +++-
.../dubbo/go-server/docker/docker-health-check.sh | 10 -
tracing/dubbo/go-server/pkg/user.go | 44 ++--
tracing/dubbo/go-server/profiles/dev/log.yml | 28 ---
tracing/dubbo/go-server/profiles/dev/server.yml | 58 ------
tracing/dubbo/go-server/profiles/release/log.yml | 28 ---
.../dubbo/go-server/profiles/release/server.yml | 62 ------
tracing/dubbo/go-server/profiles/test/log.yml | 28 ---
tracing/dubbo/go-server/profiles/test/server.yml | 62 ------
.../dubbo/go-server/tests/integration/main_test.go | 75 -------
.../tests/integration/userprovider_test.go | 79 -------
tracing/dubbo/java-client/build.sh | 21 --
tracing/dubbo/java-client/pom.xml | 230 ---------------------
.../java-client/src/main/assembly/assembly.xml | 43 ----
.../src/main/java/com/ikurento/user/Consumer.java | 60 ------
.../src/main/java/com/ikurento/user/User.java | 76 -------
.../main/java/com/ikurento/user/UserProvider.java | 18 --
.../resources/META-INF/spring/dubbo.consumer.xml | 37 ----
.../src/main/resources/META-INF/spring/service.xml | 27 ---
.../src/main/resources/dubbo.properties | 13 --
.../src/main/resources/log4j.properties | 19 --
tracing/dubbo/java-server/build.sh | 20 --
tracing/dubbo/java-server/pom.xml | 196 ------------------
tracing/dubbo/java-server/script/debug.sh | 23 ---
.../java-server/src/main/assembly/assembly.xml | 44 ----
.../src/main/java/com/ikurento/user/Provider.java | 33 ---
.../src/main/java/com/ikurento/user/User.java | 86 --------
.../main/java/com/ikurento/user/UserProvider.java | 24 ---
.../java/com/ikurento/user/UserProviderImpl.java | 30 ---
.../resources/META-INF/spring/dubbo.provider.xml | 33 ---
.../src/main/resources/dubbo.properties | 14 --
.../src/main/resources/log4j.properties | 20 --
85 files changed, 260 insertions(+), 3407 deletions(-)
diff --git a/.run/tracing-grpc-go-client.run.xml b/.run/tracing-grpc-go-client.run.xml
deleted file mode 100644
index f681ab3..0000000
--- a/.run/tracing-grpc-go-client.run.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="tracing-grpc-go-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$/tracing/grpc/go-client/profiles/dev/log.yml" />
- <env name="CONF_CONSUMER_FILE_PATH" value="$PROJECT_DIR$/tracing/grpc/go-client/profiles/dev/client.yml" />
- </envs>
- <kind value="PACKAGE" />
- <filePath value="$PROJECT_DIR$/tracing/grpc/go-client/app/client.go" />
- <package value="github.com/apache/dubbo-go-samples/tracing/grpc/go-client/app" />
- <directory value="$PROJECT_DIR$" />
- <method v="2" />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/.run/tracing-grpc-go-server.run.xml b/.run/tracing-grpc-go-server.run.xml
deleted file mode 100644
index 20dac94..0000000
--- a/.run/tracing-grpc-go-server.run.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="tracing-grpc-go-server" type="GoApplicationRunConfiguration" factoryName="Go Application" singleton="false">
- <module name="dubbo-go-samples" />
- <working_directory value="$PROJECT_DIR$" />
- <envs>
- <env name="CONF_PROVIDER_FILE_PATH" value="$PROJECT_DIR$/tracing/grpc/go-server/profiles/dev/server.yml" />
- <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/tracing/grpc/go-server/profiles/dev/log.yml" />
- </envs>
- <kind value="PACKAGE" />
- <filePath value="$PROJECT_DIR$/tracing/grpc/go-server/app/server.go" />
- <package value="github.com/apache/dubbo-go-samples/tracing/grpc/go-server/app" />
- <directory value="$PROJECT_DIR$" />
- <method v="2" />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/.run/tracing-jsonrpc-go-client.run.xml b/.run/tracing-jsonrpc-go-client.run.xml
deleted file mode 100644
index 7b7cd1f..0000000
--- a/.run/tracing-jsonrpc-go-client.run.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="tracing-jsonrpc-go-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$/tracing/jsonrpc/go-client/profiles/dev/log.yml" />
- <env name="CONF_CONSUMER_FILE_PATH" value="$PROJECT_DIR$/tracing/jsonrpc/go-client/profiles/dev/client.yml" />
- </envs>
- <kind value="PACKAGE" />
- <filePath value="$PROJECT_DIR$/tracing/jsonrpc/go-client/app/client.go" />
- <package value="github.com/apache/dubbo-go-samples/tracing/jsonrpc/go-client/app" />
- <directory value="$PROJECT_DIR$" />
- <method v="2" />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/.run/tracing-jsonrpc-go-server.run.xml b/.run/tracing-jsonrpc-go-server.run.xml
deleted file mode 100644
index 4396c03..0000000
--- a/.run/tracing-jsonrpc-go-server.run.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="tracing-jsonrpc-go-server" type="GoApplicationRunConfiguration" factoryName="Go Application" singleton="false">
- <module name="dubbo-go-samples" />
- <working_directory value="$PROJECT_DIR$" />
- <envs>
- <env name="CONF_PROVIDER_FILE_PATH" value="$PROJECT_DIR$/tracing/jsonrpc/go-server/profiles/dev/server.yml" />
- <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/tracing/jsonrpc/go-server/profiles/dev/log.yml" />
- </envs>
- <kind value="PACKAGE" />
- <filePath value="$PROJECT_DIR$/tracing/jsonrpc/go-server/app/server.go" />
- <package value="github.com/apache/dubbo-go-samples/tracing/jsonrpc/go-server/app" />
- <directory value="$PROJECT_DIR$" />
- <method v="2" />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/.run/tracing-dubbo-go-client.run.xml b/.run/tracing/dubbo/tracing-dubbo-go-client.run.xml
old mode 100755
new mode 100644
similarity index 71%
rename from .run/tracing-dubbo-go-client.run.xml
rename to .run/tracing/dubbo/tracing-dubbo-go-client.run.xml
index cf7c2d9..b1487be
--- a/.run/tracing-dubbo-go-client.run.xml
+++ b/.run/tracing/dubbo/tracing-dubbo-go-client.run.xml
@@ -3,8 +3,7 @@
<module name="dubbo-go-samples" />
<working_directory value="$PROJECT_DIR$" />
<envs>
- <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/tracing/dubbo/go-client/profiles/dev/log.yml" />
- <env name="CONF_CONSUMER_FILE_PATH" value="$PROJECT_DIR$/tracing/dubbo/go-client/profiles/dev/client.yml" />
+ <env name="DUBBO_GO_CONFIG_PATH" value="$PROJECT_DIR$/tracing/dubbo/go-client/conf/dubbogo.yml" />
</envs>
<kind value="PACKAGE" />
<filePath value="$PROJECT_DIR$/tracing/dubbo/go-client/cmd/client.go" />
diff --git a/.run/tracing-dubbo-go-server.run.xml b/.run/tracing/dubbo/tracing-dubbo-go-server.run.xml
old mode 100755
new mode 100644
similarity index 71%
rename from .run/tracing-dubbo-go-server.run.xml
rename to .run/tracing/dubbo/tracing-dubbo-go-server.run.xml
index 59bce2c..9b96eea
--- a/.run/tracing-dubbo-go-server.run.xml
+++ b/.run/tracing/dubbo/tracing-dubbo-go-server.run.xml
@@ -3,8 +3,7 @@
<module name="dubbo-go-samples" />
<working_directory value="$PROJECT_DIR$" />
<envs>
- <env name="CONF_PROVIDER_FILE_PATH" value="$PROJECT_DIR$/tracing/dubbo/go-server/profiles/dev/server.yml" />
- <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/tracing/dubbo/go-server/profiles/dev/log.yml" />
+ <env name="DUBBO_GO_CONFIG_PATH" value="$PROJECT_DIR$/tracing/dubbo/go-server/conf/dubbogo.yml" />
</envs>
<kind value="PACKAGE" />
<filePath value="$PROJECT_DIR$/tracing/dubbo/go-server/cmd/server.go" />
diff --git a/go.mod b/go.mod
index 2ccd814..41263ba 100644
--- a/go.mod
+++ b/go.mod
@@ -8,6 +8,7 @@ require (
github.com/bwmarrin/snowflake v0.3.0
github.com/dubbogo/gost v1.11.16
github.com/dubbogo/net v0.0.4
+ github.com/dubbogo/tools v0.0.0-20210910024954-b35a4f78e184 // indirect
github.com/dubbogo/triple v1.0.6-0.20210904050749-5721796f3fd6
github.com/emicklei/go-restful/v3 v3.5.2
github.com/golang/protobuf v1.5.2
diff --git a/go.sum b/go.sum
index 05bbfc9..bce78b0 100644
--- a/go.sum
+++ b/go.sum
@@ -13,6 +13,7 @@ cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqCl
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
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-rc2.0.20210904062533-3e0412eab250/go.mod h1:qzYPQolHmB+cfNhO0fUGTCWbBRdEnvyssdF8zNIiPLQ=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210915060211-8d727d630e0e h1:+aGq6bibw4z9OTQi5yqga5XN+Ekm6Ma8IjgZqrbD2YY=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210915060211-8d727d630e0e/go.mod h1:qzYPQolHmB+cfNhO0fUGTCWbBRdEnvyssdF8zNIiPLQ=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@@ -173,6 +174,8 @@ github.com/dubbogo/gost v1.11.16/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZT
github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU=
github.com/dubbogo/net v0.0.4 h1:Rn9aMPZwOiRE22YhtxmDEE3H0Q3cfVRNhuEjNMelJ/8=
github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3ujIc=
+github.com/dubbogo/tools v0.0.0-20210910024954-b35a4f78e184 h1:aTP8To5PMUDCV6uNzUPwkJ2S23m/KMpBdF7XtOxcNJI=
+github.com/dubbogo/tools v0.0.0-20210910024954-b35a4f78e184/go.mod h1:4khZ5JiSe4cYdLLYkxoOTW+Ccsffw7ic6TnAqHWpSyo=
github.com/dubbogo/triple v1.0.6-0.20210904050749-5721796f3fd6 h1:ZrCFQ/a0rgK5EBF9FiiSYvCmtC2sLzOoFAbqBVmsA94=
github.com/dubbogo/triple v1.0.6-0.20210904050749-5721796f3fd6/go.mod h1:KbfU/uZDv+fJEqXYK3qI8m1iuBQ309QxiC0tvTf2pog=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
diff --git a/tracing/README.md b/tracing/README.md
new file mode 100644
index 0000000..eb88ef8
--- /dev/null
+++ b/tracing/README.md
@@ -0,0 +1,19 @@
+# RPC Dubbo for Dubbo-go 3.0
+
+If u wanna know how to startup the client/server and the definition of APIs, please refer to [dubbo-go 3.0 quickstart](https://dubbogo.github.io/zh-cn/docs/user/quickstart/3.0/quickstart.html)
+
+## Instructions
+1. Start `zookeeper` service in `docker/docker-compose.yml` file
+2. Start the server side.
+ 1. Find the go-server folder, run the `main` function under the cmd package, and start the golang server
+3. Start the client side.
+ 1. Find the go-client folder, run the `main` function under the cmd package, and start the golang client
+4. Steps to test ziplink:
+ 1. Start the `zipkin` service in the `docker/docker-compose.yml` file
+ 2. Enable the `initZipkin()` statement of the `main` function in `go-server` and `go-client`, and commented out the `initJaeger()` statement
+ 3. Use the client to call the server-side service, and open http://localhost:9411/zipkin with a browser to see the tracing data
+5. Steps to test jaeger:
+ 1. Start the `jaeger` service in the `docker/docker-compose.yml` file
+ 2. Enable the `initJaeger()` statement of the `main` function in `go-server` and `go-client`, and commented out the `initZipkin()` statement
+ 3. Use the client to call the server-side service, and open http://localhost:16686/search with a browser to see the tracing data
+
diff --git a/tracing/README_zh.md b/tracing/README_zh.md
new file mode 100644
index 0000000..ede24cf
--- /dev/null
+++ b/tracing/README_zh.md
@@ -0,0 +1,19 @@
+# RPC Dubbo for Dubbo-go 3.0
+
+api 定义以及 go 客户端、服务端启动,可以参考 [dubbo-go 3.0 快速开始](https://dubbogo.github.io/zh-cn/docs/user/quickstart/3.0/quickstart.html)
+
+## 使用方法
+1. 启动 `docker/docker-compose.yml` 文件里的 `zookeeper` 服务
+2. 启动 server 端:
+ 1. 找到 go-server 文件夹,运行 cmd 包下的 `main` 函数,启动 golang server
+3. 启动 client 端:
+ 1. 找到 go-client 文件夹,运行 cmd 包下的 `main` 函数,启动 golang client
+4. 测试 ziplink步骤:
+ 1. 启动 `docker/docker-compose.yml` 文件里的 `zipkin` 服务
+ 2. 启用`go-server`和`go-client` 里的`main` 函数的 `initZipkin()`语句,并注释 `initJaeger()` 语句
+ 3. 使用 client 调用 server 端服务,用浏览器打开 http://localhost:9411/zipkin 即可看到tracing数据
+5. 测试jaeger步骤:
+ 1. 启动 `docker/docker-compose.yml` 文件里的 `jaeger` 服务
+ 2. 启用 `go-server` 和 `go-client` 里的 `main` 函数的 `initJaeger()` 语句,并注释 `initZipkin()` 语句
+ 3. 使用client调用server端服务,用浏览器打开 http://localhost:16686/search 即可看到tracing数据
+
diff --git a/tracing/dubbo/go-client/assembly/bin/load.sh b/tracing/dubbo/go-client/assembly/bin/load.sh
deleted file mode 100644
index ffa240b..0000000
--- a/tracing/dubbo/go-client/assembly/bin/load.sh
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-APP_NAME="APPLICATION_NAME"
-APP_ARGS=""
-SLEEP_INTERVAL=5
-MAX_LIFETIME=4000
-
-PROJECT_HOME=""
-OS_NAME=`uname`
-if [[ ${OS_NAME} != "Windows" ]]; then
- PROJECT_HOME=`pwd`
- PROJECT_HOME=${PROJECT_HOME}"/"
-else
- APP_NAME="APPLICATION_NAME.exe"
-fi
-
-export CONF_CONSUMER_FILE_PATH=${PROJECT_HOME}"TARGET_CONF_FILE"
-export APP_LOG_CONF_FILE=${PROJECT_HOME}"TARGET_LOG_CONF_FILE"
-# export GOTRACEBACK=system
-# export GODEBUG=gctrace=1
-
-usage() {
- echo "Usage: $0 start [conf suffix]"
- echo " $0 stop"
- echo " $0 term"
- echo " $0 restart"
- echo " $0 list"
- echo " $0 monitor"
- echo " $0 crontab"
- exit
-}
-
-start() {
- arg=$1
- if [ "$arg" = "" ];then
- echo "No registry type! Default client.yml!"
- else
- export CONF_CONSUMER_FILE_PATH=${CONF_CONSUMER_FILE_PATH//\.yml/\_$arg\.yml}
- fi
- if [ ! -f "${CONF_CONSUMER_FILE_PATH}" ];then
- echo $CONF_CONSUMER_FILE_PATH" is not existing!"
- return
- fi
- APP_LOG_PATH=${PROJECT_HOME}"logs/"
- mkdir -p ${APP_LOG_PATH}
- APP_BIN=${PROJECT_HOME}sbin/${APP_NAME}
- chmod u+x ${APP_BIN}
- # CMD="nohup ${APP_BIN} ${APP_ARGS} >>${APP_NAME}.nohup.out 2>&1 &"
- CMD="${APP_BIN}"
- eval ${CMD}
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- CUR=`date +%FT%T`
- if [ "${PID}" != "" ]; then
- for p in ${PID}
- do
- echo "start ${APP_NAME} ( pid =" ${p} ") at " ${CUR}
- done
- fi
-}
-
-stop() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -SIGINT ${APP_NAME} ( pid =" ${ps} ")"
- kill -2 ${ps}
- done
- fi
-}
-
-
-term() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -9 ${APP_NAME} ( pid =" ${ps} ")"
- kill -9 ${ps}
- done
- fi
-}
-
-list() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s\n", $1, $2, $9, $10)}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s,%s\n", $1, $4, $6, $7, $8)}'`
- fi
-
- if [ "${PID}" != "" ]; then
- echo "list ${APP_NAME}"
-
- if [[ ${OS_NAME} == "Linux" || ${OS_NAME} == "Darwin" ]]; then
- echo "index: user, pid, start, duration"
- else
- echo "index: PID, WINPID, UID, STIME, COMMAND"
- fi
- idx=0
- for ps in ${PID}
- do
- echo "${idx}: ${ps}"
- ((idx ++))
- done
- fi
-}
-
-monitor() {
- idx=0
- while true; do
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [[ "${PID}" == "" ]]; then
- start
- idx=0
- fi
-
- ((LIFE=idx*${SLEEP_INTERVAL}))
- echo "${APP_NAME} ( pid = " ${PID} ") has been working in normal state for " $LIFE " seconds."
- ((idx ++))
- sleep ${SLEEP_INTERVAL}
- done
-}
-
-crontab() {
- idx=0
- while true; do
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [[ "${PID}" == "" ]]; then
- start
- idx=0
- fi
-
- ((LIFE=idx*${SLEEP_INTERVAL}))
- echo "${APP_NAME} ( pid = " ${PID} ") has been working in normal state for " $LIFE " seconds."
- ((idx ++))
- sleep ${SLEEP_INTERVAL}
- if [[ ${LIFE} -gt ${MAX_LIFETIME} ]]; then
- kill -9 ${PID}
- fi
- done
-}
-
-opt=$1
-case C"$opt" in
- Cstart)
- start $2
- ;;
- Cstop)
- stop
- ;;
- Cterm)
- term
- ;;
- Crestart)
- term
- start $2
- ;;
- Clist)
- list
- ;;
- Cmonitor)
- monitor
- ;;
- Ccrontab)
- crontab
- ;;
- C*)
- usage
- ;;
-esac
-
diff --git a/tracing/dubbo/go-client/assembly/common/app.properties b/tracing/dubbo/go-client/assembly/common/app.properties
deleted file mode 100644
index e10868f..0000000
--- a/tracing/dubbo/go-client/assembly/common/app.properties
+++ /dev/null
@@ -1,23 +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.
-
-
-export TARGET_EXEC_NAME="user_info_client"
-# BUILD_PACKAGE="dubbogo-examples/user-info/client/app"
-export BUILD_PACKAGE="app"
-
-export TARGET_CONF_FILE="conf/client.yml"
-export TARGET_LOG_CONF_FILE="conf/log.yml"
diff --git a/tracing/dubbo/go-client/assembly/common/build.sh b/tracing/dubbo/go-client/assembly/common/build.sh
deleted file mode 100644
index d38f889..0000000
--- a/tracing/dubbo/go-client/assembly/common/build.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-rm -rf target/
-
-PROJECT_HOME=`pwd`
-TARGET_FOLDER=${PROJECT_HOME}/target/${GOOS}
-
-TARGET_SBIN_NAME=${TARGET_EXEC_NAME}
-version=`cat app/version.go | grep Version | grep -v "Apache" | awk -F '=' '{print $2}' | awk -F '"' '{print $2}'`
-if [[ ${GOOS} == "windows" ]]; then
- TARGET_SBIN_NAME=${TARGET_SBIN_NAME}.exe
-fi
-TARGET_NAME=${TARGET_FOLDER}/${TARGET_SBIN_NAME}
-if [[ $PROFILE == "dev" || $PROFILE == "test" ]]; then
- # GFLAGS=-gcflags "-N -l" -race -x -v # -x会把go build的详细过程输出
- # GFLAGS=-gcflags "-N -l" -race -v
- # GFLAGS="-gcflags \"-N -l\" -v"
- cd ${BUILD_PACKAGE} && GOOS=$GOOS GOARCH=$GOARCH GO111MODULE=on go build -gcflags "-N -l" -x -v -i -o ${TARGET_NAME} && cd -
-else
- # -s去掉符号表(然后panic时候的stack trace就没有任何文件名/行号信息了,这个等价于普通C/C++程序被strip的效果),
- # -w去掉DWARF调试信息,得到的程序就不能用gdb调试了。-s和-w也可以分开使用,一般来说如果不打算用gdb调试,
- # -w基本没啥损失。-s的损失就有点大了。
- cd ${BUILD_PACKAGE} && GOOS=$GOOS GOARCH=$GOARCH GO111MODULE=on go build -ldflags "-w" -x -v -i -o ${TARGET_NAME} && cd -
-fi
-
-TAR_NAME=${TARGET_EXEC_NAME}-${version}-`date "+%Y%m%d-%H%M"`-${PROFILE}
-
-mkdir -p ${TARGET_FOLDER}/${TAR_NAME}
-
-SBIN_DIR=${TARGET_FOLDER}/${TAR_NAME}/sbin
-BIN_DIR=${TARGET_FOLDER}/${TAR_NAME}
-CONF_DIR=${TARGET_FOLDER}/${TAR_NAME}/conf
-
-mkdir -p ${SBIN_DIR}
-mkdir -p ${CONF_DIR}
-
-mv ${TARGET_NAME} ${SBIN_DIR}
-cp -r assembly/bin ${BIN_DIR}
-cd ${BIN_DIR}/bin/ && mv load.sh load_${TARGET_EXEC_NAME}.sh && cd -
-
-platform=$(uname)
-# modify APPLICATION_NAME
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-fi
-
-# modify TARGET_CONF_FILE
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-# modify TARGET_LOG_CONF_FILE
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-cp -r profiles/${PROFILE}/* ${CONF_DIR}
-
-cd ${TARGET_FOLDER}
-
-tar czf ${TAR_NAME}.tar.gz ${TAR_NAME}/*
-
diff --git a/tracing/dubbo/go-client/assembly/linux/dev.sh b/tracing/dubbo/go-client/assembly/linux/dev.sh
deleted file mode 100644
index eada737..0000000
--- a/tracing/dubbo/go-client/assembly/linux/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="dev"
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/assembly/linux/release.sh b/tracing/dubbo/go-client/assembly/linux/release.sh
deleted file mode 100644
index 10eb3d7..0000000
--- a/tracing/dubbo/go-client/assembly/linux/release.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/assembly/linux/test.sh b/tracing/dubbo/go-client/assembly/linux/test.sh
deleted file mode 100644
index 78b650c..0000000
--- a/tracing/dubbo/go-client/assembly/linux/test.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/assembly/mac/dev.sh b/tracing/dubbo/go-client/assembly/mac/dev.sh
deleted file mode 100644
index c828476..0000000
--- a/tracing/dubbo/go-client/assembly/mac/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="dev"
-
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/assembly/mac/release.sh b/tracing/dubbo/go-client/assembly/mac/release.sh
deleted file mode 100644
index 91c2dfe..0000000
--- a/tracing/dubbo/go-client/assembly/mac/release.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/assembly/mac/test.sh b/tracing/dubbo/go-client/assembly/mac/test.sh
deleted file mode 100644
index a7853f5..0000000
--- a/tracing/dubbo/go-client/assembly/mac/test.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/assembly/windows/dev.sh b/tracing/dubbo/go-client/assembly/windows/dev.sh
deleted file mode 100644
index 10a3866..0000000
--- a/tracing/dubbo/go-client/assembly/windows/dev.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="dev"
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/assembly/windows/release.sh b/tracing/dubbo/go-client/assembly/windows/release.sh
deleted file mode 100644
index 21af573..0000000
--- a/tracing/dubbo/go-client/assembly/windows/release.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/assembly/windows/test.sh b/tracing/dubbo/go-client/assembly/windows/test.sh
deleted file mode 100644
index 2104da8..0000000
--- a/tracing/dubbo/go-client/assembly/windows/test.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-client/cmd/client.go b/tracing/dubbo/go-client/cmd/client.go
index e8854df..8bdc968 100644
--- a/tracing/dubbo/go-client/cmd/client.go
+++ b/tracing/dubbo/go-client/cmd/client.go
@@ -27,19 +27,13 @@ import (
)
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/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+ _ "dubbo.apache.org/dubbo-go/v3/imports"
hessian "github.com/apache/dubbo-go-hessian2"
- "github.com/dubbogo/gost/log"
+ "github.com/apache/dubbo-go-samples/tracing/dubbo/go-client/pkg"
"github.com/opentracing/opentracing-go"
@@ -47,39 +41,30 @@ import (
"github.com/openzipkin/zipkin-go"
zipkinhttp "github.com/openzipkin/zipkin-go/reporter/http"
-)
-import (
- "github.com/apache/dubbo-go-samples/tracing/dubbo/go-client/pkg"
+ "github.com/uber/jaeger-client-go"
+ jaegerConfig "github.com/uber/jaeger-client-go/config"
)
var (
- userProvider = &pkg.UserProvider{}
survivalTimeout int = 10e9
+ userProvider = new(pkg.UserProvider)
)
-func init() {
- config.SetConsumerService(userProvider)
- hessian.RegisterPOJO(&pkg.User{})
-}
-
-// they are necessary:
-// export CONF_CONSUMER_FILE_PATH="xxx"
-// export APP_LOG_CONF_FILE="xxx"
func main() {
hessian.RegisterPOJO(&pkg.User{})
+ config.SetConsumerService(userProvider)
config.Load()
-
+ // initJaeger() and initZipkin() can only use one at the same time
+ //initJaeger()
initZipkin()
- gxlog.CInfo("\n\n\nstart to test dubbo")
- user := &pkg.User{}
- span, ctx := opentracing.StartSpanFromContext(context.Background(), "Test-Client-Service")
- err := userProvider.GetUser(ctx, []interface{}{"A001"}, user)
+ span, ctx := opentracing.StartSpanFromContext(context.Background(), "Dubbogo-Client-Service")
+ user, err := userProvider.GetUser(ctx, []interface{}{"A003"})
span.Finish()
if err != nil {
panic(err)
}
- gxlog.CInfo("response result: %v\n", user)
+ logger.Info("response result: %v", user)
initSignal()
}
@@ -99,7 +84,6 @@ func initSignal() {
logger.Warnf("app exit now by force...")
os.Exit(1)
})
-
// The program exits normally or timeout forcibly exits.
fmt.Println("app exit now...")
return
@@ -107,25 +91,36 @@ func initSignal() {
}
}
+func initJaeger() {
+ cfg := jaegerConfig.Configuration{
+ ServiceName: "dobbugoJaegerTracingService",
+ Sampler: &jaegerConfig.SamplerConfig{
+ Type: jaeger.SamplerTypeRemote,
+ Param: 1,
+ },
+ Reporter: &jaegerConfig.ReporterConfig{
+ LocalAgentHostPort: "127.0.0.1:6831",
+ LogSpans: true,
+ BufferFlushInterval: 5 * time.Second,
+ },
+ }
+ nativeTracer, _, err := cfg.NewTracer(jaegerConfig.Logger(jaeger.StdLogger))
+ if err != nil {
+ logger.Errorf("unable to create jaeger tracer: %+v\n", err)
+ }
+ opentracing.SetGlobalTracer(nativeTracer)
+}
+
func initZipkin() {
- // set up a span reporter
reporter := zipkinhttp.NewReporter("http://localhost:9411/api/v2/spans")
-
- // create our local service endpoint
- endpoint, err := zipkin.NewEndpoint("myService", "myservice.mydomain.com:80")
+ endpoint, err := zipkin.NewEndpoint("dobbugoZipkinTracingService", "myservice.mydomain.com:80")
if err != nil {
logger.Errorf("unable to create local endpoint: %+v\n", err)
}
-
- // initialize our tracer
nativeTracer, err := zipkin.NewTracer(reporter, zipkin.WithLocalEndpoint(endpoint))
if err != nil {
logger.Errorf("unable to create tracer: %+v\n", err)
}
-
- // use zipkin-go-opentracing to wrap our tracer
tracer := zipkinot.Wrap(nativeTracer)
-
- // optionally set as Global OpenTracing tracer instance
opentracing.SetGlobalTracer(tracer)
}
diff --git a/tracing/dubbo/go-client/cmd/version.go b/tracing/dubbo/go-client/cmd/version.go
deleted file mode 100644
index ae51f45..0000000
--- a/tracing/dubbo/go-client/cmd/version.go
+++ /dev/null
@@ -1,22 +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
-
-var (
- Version = "2.7.5"
-)
diff --git a/tracing/dubbo/go-client/conf/client.yml b/tracing/dubbo/go-client/conf/client.yml
deleted file mode 100644
index 3bcc1cd..0000000
--- a/tracing/dubbo/go-client/conf/client.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info client"
- version : "0.0.1"
- owner : "ZX"
- environment : "test"
-
-registries :
- "hangzhouzk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-references:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "hangzhouzk"
- protocol : "dubbo"
- interface : "com.ikurento.user.UserProvider"
- cluster: "failover"
- methods :
- - name: "GetUser"
- retries: 3
-
-protocol_conf:
- dubbo:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "180s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
-
-filter: "tracing"
\ No newline at end of file
diff --git a/tracing/dubbo/go-client/conf/dubbogo.yml b/tracing/dubbo/go-client/conf/dubbogo.yml
new file mode 100644
index 0000000..ab08480
--- /dev/null
+++ b/tracing/dubbo/go-client/conf/dubbogo.yml
@@ -0,0 +1,16 @@
+# dubbo client yaml configure file
+
+dubbo:
+ registries:
+ demoZK:
+ protocol: zookeeper
+ timeout: 3s
+ address: 127.0.0.1:2181
+ consumer:
+ filter: tracing
+ registry:
+ - demoZK
+ references:
+ UserProvider:
+ protocol: dubbo
+ interface: org.apache.dubbo.UserProvider
\ No newline at end of file
diff --git a/tracing/dubbo/go-client/conf/log.yml b/tracing/dubbo/go-client/conf/log.yml
deleted file mode 100644
index baee0b7..0000000
--- a/tracing/dubbo/go-client/conf/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "info"
-development: false
-disableCaller: false
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/tracing/dubbo/go-client/docker/docker-compose.yml b/tracing/dubbo/go-client/docker/docker-compose.yml
new file mode 100644
index 0000000..6ee92b6
--- /dev/null
+++ b/tracing/dubbo/go-client/docker/docker-compose.yml
@@ -0,0 +1,44 @@
+version: '3'
+
+services:
+ zookeeper:
+ image: zookeeper
+ ports:
+ - 2181:2181
+ restart: on-failure
+
+ jaeger:
+ image: jaegertracing/all-in-one
+ ports:
+ - "6831:6831/udp"
+ - "16686:16686"
+ networks:
+ - jaeger-example
+
+ zipkin:
+ image: openzipkin/zipkin
+ container_name: zipkin
+ environment:
+ - STORAGE_TYPE=mysql
+ - MYSQL_HOST=mysql
+ - MYSQL_TCP_PORT=3306
+ - MYSQL_USER=zipkin
+ - MYSQL_PASS=zipkin
+ ports:
+ # Listen port for the Scribe transport
+ - 9410:9410
+ # Port used for the Zipkin UI and HTTP Api
+ - 9411:9411
+ depends_on:
+ - storage
+
+ storage:
+ image: openzipkin/zipkin-mysql
+ container_name: mysql
+ ports:
+ - 3307:3306
+
+
+networks:
+ jaeger-example:
+
\ No newline at end of file
diff --git a/tracing/dubbo/go-client/pkg/user.go b/tracing/dubbo/go-client/pkg/user.go
index 42c7eb9..1890be9 100644
--- a/tracing/dubbo/go-client/pkg/user.go
+++ b/tracing/dubbo/go-client/pkg/user.go
@@ -19,24 +19,32 @@ package pkg
import (
"context"
+ "fmt"
"time"
)
type User struct {
- ID string
+ Id string
Name string
Age int32
Time time.Time
}
+func (u User) String() string {
+ return fmt.Sprintf(
+ "User{ID:%s, Name:%s, Age:%d, Time:%s}",
+ u.Id, u.Name, u.Age, u.Time,
+ )
+}
+
+func (User) JavaClassName() string {
+ return "org.apache.dubbo.User"
+}
+
type UserProvider struct {
- GetUser func(ctx context.Context, req []interface{}, rsp *User) error
+ GetUser func(ctx context.Context, req []interface{}) (*User, error)
}
func (u *UserProvider) Reference() string {
return "UserProvider"
}
-
-func (User) JavaClassName() string {
- return "com.ikurento.user.User"
-}
diff --git a/tracing/dubbo/go-client/profiles/dev/client.yml b/tracing/dubbo/go-client/profiles/dev/client.yml
deleted file mode 100644
index d8122d4..0000000
--- a/tracing/dubbo/go-client/profiles/dev/client.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-
-references:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "dubbo"
- interface : "com.ikurento.user.UserProvider"
- cluster: "failover"
- methods :
- - name: "GetUser"
- retries: 3
-
-
-protocol_conf:
- dubbo:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "180s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
-
-filter: "tracing"
\ No newline at end of file
diff --git a/tracing/dubbo/go-client/profiles/dev/log.yml b/tracing/dubbo/go-client/profiles/dev/log.yml
deleted file mode 100644
index 59fa427..0000000
--- a/tracing/dubbo/go-client/profiles/dev/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-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: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/tracing/dubbo/go-client/profiles/release/client.yml b/tracing/dubbo/go-client/profiles/release/client.yml
deleted file mode 100644
index bd93a77..0000000
--- a/tracing/dubbo/go-client/profiles/release/client.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info client"
- version : "0.0.1"
- owner : "ZX"
- environment : "release"
-
-registries :
- "hangzhouzk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-
-references:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "hangzhouzk"
- protocol : "dubbo"
- interface : "com.ikurento.user.UserProvider"
- cluster: "failover"
- methods :
- - name: "GetUser"
- retries: 3
-
-protocol_conf:
- dubbo:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "180s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
diff --git a/tracing/dubbo/go-client/profiles/release/log.yml b/tracing/dubbo/go-client/profiles/release/log.yml
deleted file mode 100644
index e0514be..0000000
--- a/tracing/dubbo/go-client/profiles/release/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "warn"
-development: true
-disableCaller: true
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/tracing/dubbo/go-client/profiles/test/client.yml b/tracing/dubbo/go-client/profiles/test/client.yml
deleted file mode 100644
index 3bcc1cd..0000000
--- a/tracing/dubbo/go-client/profiles/test/client.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info client"
- version : "0.0.1"
- owner : "ZX"
- environment : "test"
-
-registries :
- "hangzhouzk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-references:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "hangzhouzk"
- protocol : "dubbo"
- interface : "com.ikurento.user.UserProvider"
- cluster: "failover"
- methods :
- - name: "GetUser"
- retries: 3
-
-protocol_conf:
- dubbo:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "180s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
-
-filter: "tracing"
\ No newline at end of file
diff --git a/tracing/dubbo/go-client/profiles/test/log.yml b/tracing/dubbo/go-client/profiles/test/log.yml
deleted file mode 100644
index baee0b7..0000000
--- a/tracing/dubbo/go-client/profiles/test/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "info"
-development: false
-disableCaller: false
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/tracing/dubbo/go-server/assembly/bin/load.sh b/tracing/dubbo/go-server/assembly/bin/load.sh
deleted file mode 100644
index 90077c2..0000000
--- a/tracing/dubbo/go-server/assembly/bin/load.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-APP_NAME="APPLICATION_NAME"
-APP_ARGS=""
-
-
-PROJECT_HOME=""
-OS_NAME=`uname`
-if [[ ${OS_NAME} != "Windows" ]]; then
- PROJECT_HOME=`pwd`
- PROJECT_HOME=${PROJECT_HOME}"/"
-fi
-
-export CONF_PROVIDER_FILE_PATH=${PROJECT_HOME}"TARGET_CONF_FILE"
-export APP_LOG_CONF_FILE=${PROJECT_HOME}"TARGET_LOG_CONF_FILE"
-
-usage() {
- echo "Usage: $0 start [conf suffix]"
- echo " $0 stop"
- echo " $0 term"
- echo " $0 restart"
- echo " $0 list"
- echo " $0 monitor"
- echo " $0 crontab"
- exit
-}
-
-start() {
- arg=$1
- if [ "$arg" = "" ];then
- echo "No registry type! Default server.yml!"
- else
- export CONF_PROVIDER_FILE_PATH=${CONF_PROVIDER_FILE_PATH//\.yml/\_$arg\.yml}
- fi
- if [ ! -f "${CONF_PROVIDER_FILE_PATH}" ];then
- echo $CONF_PROVIDER_FILE_PATH" is not existing!"
- return
- fi
- APP_LOG_PATH="${PROJECT_HOME}logs/"
- mkdir -p ${APP_LOG_PATH}
- APP_BIN=${PROJECT_HOME}sbin/${APP_NAME}
- chmod u+x ${APP_BIN}
- # CMD="nohup ${APP_BIN} ${APP_ARGS} >>${APP_NAME}.nohup.out 2>&1 &"
- CMD="${APP_BIN}"
- eval ${CMD}
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- CUR=`date +%FT%T`
- if [ "${PID}" != "" ]; then
- for p in ${PID}
- do
- echo "start ${APP_NAME} ( pid =" ${p} ") at " ${CUR}
- done
- fi
-}
-
-stop() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -SIGINT ${APP_NAME} ( pid =" ${ps} ")"
- kill -2 ${ps}
- done
- fi
-}
-
-
-term() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -9 ${APP_NAME} ( pid =" ${ps} ")"
- kill -9 ${ps}
- done
- fi
-}
-
-list() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s\n", $1, $2, $9, $10)}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s,%s\n", $1, $4, $6, $7, $8)}'`
- fi
-
- if [ "${PID}" != "" ]; then
- echo "list ${APP_NAME}"
-
- if [[ ${OS_NAME} == "Linux" || ${OS_NAME} == "Darwin" ]]; then
- echo "index: user, pid, start, duration"
- else
- echo "index: PID, WINPID, UID, STIME, COMMAND"
- fi
- idx=0
- for ps in ${PID}
- do
- echo "${idx}: ${ps}"
- ((idx ++))
- done
- fi
-}
-
-opt=$1
-case C"$opt" in
- Cstart)
- start $2
- ;;
- Cstop)
- stop
- ;;
- Cterm)
- term
- ;;
- Crestart)
- term
- start $2
- ;;
- Clist)
- list
- ;;
- C*)
- usage
- ;;
-esac
-
diff --git a/tracing/dubbo/go-server/assembly/common/app.properties b/tracing/dubbo/go-server/assembly/common/app.properties
deleted file mode 100644
index 1f0827e..0000000
--- a/tracing/dubbo/go-server/assembly/common/app.properties
+++ /dev/null
@@ -1,23 +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.
-
-
-TARGET_EXEC_NAME="user_info_server"
-# BUILD_PACKAGE="dubbogo-examples/user-info/server/app"
-BUILD_PACKAGE="app"
-
-TARGET_CONF_FILE="conf/server.yml"
-TARGET_LOG_CONF_FILE="conf/log.yml"
diff --git a/tracing/dubbo/go-server/assembly/common/build.sh b/tracing/dubbo/go-server/assembly/common/build.sh
deleted file mode 100644
index d90d026..0000000
--- a/tracing/dubbo/go-server/assembly/common/build.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-rm -rf target/
-
-PROJECT_HOME=`pwd`
-TARGET_FOLDER=${PROJECT_HOME}/target/${GOOS}
-
-TARGET_SBIN_NAME=${TARGET_EXEC_NAME}
-version=`cat app/version.go | grep Version | grep -v "Apache" | awk -F '=' '{print $2}' | awk -F '"' '{print $2}'`
-if [[ ${GOOS} == "windows" ]]; then
- TARGET_SBIN_NAME=${TARGET_SBIN_NAME}.exe
-fi
-TARGET_NAME=${TARGET_FOLDER}/${TARGET_SBIN_NAME}
-if [[ $PROFILE = "test" ]]; then
- # GFLAGS=-gcflags "-N -l" -race -x -v # -x会把go build的详细过程输出
- # GFLAGS=-gcflags "-N -l" -race -v
- # GFLAGS="-gcflags \"-N -l\" -v"
- cd ${BUILD_PACKAGE} && GO111MODULE=on go build -gcflags "-N -l" -x -v -i -o ${TARGET_NAME} && cd -
-else
- # -s去掉符号表(然后panic时候的stack trace就没有任何文件名/行号信息了,这个等价于普通C/C++程序被strip的效果),
- # -w去掉DWARF调试信息,得到的程序就不能用gdb调试了。-s和-w也可以分开使用,一般来说如果不打算用gdb调试,
- # -w基本没啥损失。-s的损失就有点大了。
- cd ${BUILD_PACKAGE} && GO111MODULE=on go build -ldflags "-w" -x -v -i -o ${TARGET_NAME} && cd -
-fi
-
-TAR_NAME=${TARGET_EXEC_NAME}-${version}-`date "+%Y%m%d-%H%M"`-${PROFILE}
-
-mkdir -p ${TARGET_FOLDER}/${TAR_NAME}
-
-SBIN_DIR=${TARGET_FOLDER}/${TAR_NAME}/sbin
-BIN_DIR=${TARGET_FOLDER}/${TAR_NAME}
-CONF_DIR=${TARGET_FOLDER}/${TAR_NAME}/conf
-
-mkdir -p ${SBIN_DIR}
-mkdir -p ${CONF_DIR}
-
-mv ${TARGET_NAME} ${SBIN_DIR}
-cp -r assembly/bin ${BIN_DIR}
-# modify APPLICATION_NAME
-# OS=`uname`
-# if [[ $OS=="Darwin" ]]; then
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-fi
-# modify TARGET_CONF_FILE
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-# modify TARGET_LOG_CONF_FILE
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-cp -r profiles/${PROFILE}/* ${CONF_DIR}
-
-cd ${TARGET_FOLDER}
-
-tar czf ${TAR_NAME}.tar.gz ${TAR_NAME}/*
-
diff --git a/tracing/dubbo/go-server/assembly/linux/dev.sh b/tracing/dubbo/go-server/assembly/linux/dev.sh
deleted file mode 100644
index d830ac9..0000000
--- a/tracing/dubbo/go-server/assembly/linux/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-server/assembly/linux/release.sh b/tracing/dubbo/go-server/assembly/linux/release.sh
deleted file mode 100644
index 9930380..0000000
--- a/tracing/dubbo/go-server/assembly/linux/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-server/assembly/linux/test.sh b/tracing/dubbo/go-server/assembly/linux/test.sh
deleted file mode 100644
index 87144bb..0000000
--- a/tracing/dubbo/go-server/assembly/linux/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-server/assembly/mac/dev.sh b/tracing/dubbo/go-server/assembly/mac/dev.sh
deleted file mode 100644
index 3a7659b..0000000
--- a/tracing/dubbo/go-server/assembly/mac/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-server/assembly/mac/release.sh b/tracing/dubbo/go-server/assembly/mac/release.sh
deleted file mode 100644
index 1c4bce4..0000000
--- a/tracing/dubbo/go-server/assembly/mac/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-server/assembly/mac/test.sh b/tracing/dubbo/go-server/assembly/mac/test.sh
deleted file mode 100644
index 69206e3..0000000
--- a/tracing/dubbo/go-server/assembly/mac/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
-
diff --git a/tracing/dubbo/go-server/assembly/windows/dev.sh b/tracing/dubbo/go-server/assembly/windows/dev.sh
deleted file mode 100644
index 011fb41..0000000
--- a/tracing/dubbo/go-server/assembly/windows/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-server/assembly/windows/release.sh b/tracing/dubbo/go-server/assembly/windows/release.sh
deleted file mode 100644
index 679a26a..0000000
--- a/tracing/dubbo/go-server/assembly/windows/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-server/assembly/windows/test.sh b/tracing/dubbo/go-server/assembly/windows/test.sh
deleted file mode 100644
index 4a36de0..0000000
--- a/tracing/dubbo/go-server/assembly/windows/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/tracing/dubbo/go-server/cmd/server.go b/tracing/dubbo/go-server/cmd/server.go
index dde2bd8..5f28cb4 100644
--- a/tracing/dubbo/go-server/cmd/server.go
+++ b/tracing/dubbo/go-server/cmd/server.go
@@ -26,49 +26,41 @@ import (
)
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/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+ _ "dubbo.apache.org/dubbo-go/v3/imports"
hessian "github.com/apache/dubbo-go-hessian2"
+ "github.com/apache/dubbo-go-samples/tracing/dubbo/go-server/pkg"
+
"github.com/opentracing/opentracing-go"
zipkinot "github.com/openzipkin-contrib/zipkin-go-opentracing"
"github.com/openzipkin/zipkin-go"
zipkinhttp "github.com/openzipkin/zipkin-go/reporter/http"
-)
-import (
- "github.com/apache/dubbo-go-samples/tracing/dubbo/go-server/pkg"
+ "github.com/uber/jaeger-client-go"
+ jaegerConfig "github.com/uber/jaeger-client-go/config"
)
var (
survivalTimeout = int(3e9)
)
-// they are necessary:
-// export CONF_PROVIDER_FILE_PATH="xxx"
-// export APP_LOG_CONF_FILE="xxx"
func main() {
-
+ config.SetProviderService(new(pkg.UserProvider))
hessian.RegisterPOJO(&pkg.User{})
config.Load()
-
- initZipkin()
initSignal()
+ // initJaeger() and initZipkin() can only use one at the same time
+ //initJaeger()
+ initZipkin()
}
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
@@ -81,7 +73,6 @@ func initSignal() {
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
@@ -89,25 +80,36 @@ func initSignal() {
}
}
+func initJaeger() {
+ cfg := jaegerConfig.Configuration{
+ ServiceName: "dobbugoJaegerTracingService",
+ Sampler: &jaegerConfig.SamplerConfig{
+ Type: jaeger.SamplerTypeRemote,
+ Param: 1,
+ },
+ Reporter: &jaegerConfig.ReporterConfig{
+ LocalAgentHostPort: "127.0.0.1:6831",
+ LogSpans: true,
+ BufferFlushInterval: 5 * time.Second,
+ },
+ }
+ nativeTracer, _, err := cfg.NewTracer(jaegerConfig.Logger(jaeger.StdLogger))
+ if err != nil {
+ logger.Errorf("unable to create jaeger tracer: %+v\n", err)
+ }
+ opentracing.SetGlobalTracer(nativeTracer)
+}
+
func initZipkin() {
- // set up a span reporter
reporter := zipkinhttp.NewReporter("http://localhost:9411/api/v2/spans")
-
- // create our local service endpoint
- endpoint, err := zipkin.NewEndpoint("myService", "myservice.mydomain.com:80")
+ endpoint, err := zipkin.NewEndpoint("dobbugoZipkinTracingService", "myservice.mydomain.com:80")
if err != nil {
logger.Errorf("unable to create local endpoint: %+v\n", err)
}
-
- // initialize our tracer
nativeTracer, err := zipkin.NewTracer(reporter, zipkin.WithLocalEndpoint(endpoint))
if err != nil {
logger.Errorf("unable to create tracer: %+v\n", err)
}
-
- // use zipkin-go-opentracing to wrap our tracer
tracer := zipkinot.Wrap(nativeTracer)
-
- // optionally set as Global OpenTracing tracer instance
opentracing.SetGlobalTracer(tracer)
}
diff --git a/tracing/dubbo/go-server/cmd/version.go b/tracing/dubbo/go-server/cmd/version.go
deleted file mode 100644
index ae51f45..0000000
--- a/tracing/dubbo/go-server/cmd/version.go
+++ /dev/null
@@ -1,22 +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
-
-var (
- Version = "2.7.5"
-)
diff --git a/tracing/dubbo/go-server/conf/client.yml b/tracing/dubbo/go-server/conf/client.yml
deleted file mode 100644
index 3bcc1cd..0000000
--- a/tracing/dubbo/go-server/conf/client.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info client"
- version : "0.0.1"
- owner : "ZX"
- environment : "test"
-
-registries :
- "hangzhouzk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-references:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "hangzhouzk"
- protocol : "dubbo"
- interface : "com.ikurento.user.UserProvider"
- cluster: "failover"
- methods :
- - name: "GetUser"
- retries: 3
-
-protocol_conf:
- dubbo:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "180s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
-
-filter: "tracing"
\ No newline at end of file
diff --git a/tracing/dubbo/go-server/conf/dubbogo.yml b/tracing/dubbo/go-server/conf/dubbogo.yml
new file mode 100644
index 0000000..1c8aadb
--- /dev/null
+++ b/tracing/dubbo/go-server/conf/dubbogo.yml
@@ -0,0 +1,24 @@
+# dubbo server yaml configure file
+
+dubbo:
+ registries:
+ demoZK:
+ protocol: zookeeper
+ timeout: 3s
+ address: 127.0.0.1:2181
+ protocols:
+ dubbo:
+ name: dubbo
+ port: 20000
+ provider:
+ filter: tracing
+ registry:
+ - demoZK
+ services:
+ UserProvider:
+ protocol: dubbo
+ interface: org.apache.dubbo.UserProvider
+ loadbalance: random
+ warmup: 100
+ cluster: failover
+
diff --git a/tracing/dubbo/go-server/conf/log.yml b/tracing/dubbo/go-server/conf/log.yml
deleted file mode 100644
index baee0b7..0000000
--- a/tracing/dubbo/go-server/conf/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "info"
-development: false
-disableCaller: false
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/tracing/dubbo/go-server/conf/server.yml b/tracing/dubbo/go-server/conf/server.yml
deleted file mode 100644
index 4e101f5..0000000
--- a/tracing/dubbo/go-server/conf/server.yml
+++ /dev/null
@@ -1,62 +0,0 @@
-# dubbo server yaml configure file
-
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info server"
- version : "0.0.1"
- owner : "ZX"
- environment : "test"
-
-registries :
- "hangzhouzk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-
-
-services:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "hangzhouzk"
- protocol : "dubbo"
- # 相当于dubbo.xml中的interface
- interface : "com.ikurento.user.UserProvider"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "GetUser"
- retries: 1
- loadbalance: "random"
-
-protocols:
- "dubbo":
- name: "dubbo"
- # ip : "127.0.0.1"
- port: 20000
-
-
-protocol_conf:
- dubbo:
- session_number: 700
- session_timeout: "180s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/tracing/dubbo/go-server/docker/docker-compose.yml b/tracing/dubbo/go-server/docker/docker-compose.yml
index 386a42e..1d5c7f7 100644
--- a/tracing/dubbo/go-server/docker/docker-compose.yml
+++ b/tracing/dubbo/go-server/docker/docker-compose.yml
@@ -5,4 +5,38 @@ services:
image: zookeeper
ports:
- 2181:2181
- restart: on-failure
\ No newline at end of file
+ restart: on-failure
+
+ jaeger:
+ image: jaegertracing/all-in-one
+ ports:
+ - "6831:6831/udp"
+ - "16686:16686"
+ networks:
+ - jaeger-example
+
+ zipkin:
+ image: openzipkin/zipkin
+ container_name: zipkin
+ environment:
+ - STORAGE_TYPE=mysql
+ - MYSQL_HOST=mysql
+ - MYSQL_TCP_PORT=3306
+ - MYSQL_USER=zipkin
+ - MYSQL_PASS=zipkin
+ ports:
+ # Listen port for the Scribe transport
+ - 9410:9410
+ # Port used for the Zipkin UI and HTTP Api
+ - 9411:9411
+ depends_on:
+ - storage
+
+ storage:
+ image: openzipkin/zipkin-mysql
+ container_name: mysql
+ ports:
+ - 3307:3306
+
+networks:
+ jaeger-example:
diff --git a/tracing/dubbo/go-server/docker/docker-health-check.sh b/tracing/dubbo/go-server/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/tracing/dubbo/go-server/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/tracing/dubbo/go-server/pkg/user.go b/tracing/dubbo/go-server/pkg/user.go
index 262d2ab..b86b51b 100644
--- a/tracing/dubbo/go-server/pkg/user.go
+++ b/tracing/dubbo/go-server/pkg/user.go
@@ -19,49 +19,47 @@ package pkg
import (
"context"
+ "fmt"
"time"
)
import (
- "dubbo.apache.org/dubbo-go/v3/config"
-
- hessian "github.com/apache/dubbo-go-hessian2"
-
- "github.com/dubbogo/gost/log"
+ gxlog "github.com/dubbogo/gost/log"
"github.com/opentracing/opentracing-go"
)
-func init() {
- config.SetProviderService(new(UserProvider))
- // ------for hessian2------
- hessian.RegisterPOJO(&User{})
+type (
+ User struct {
+ Id string
+ Name string
+ Age int32
+ Time time.Time
+ }
+)
+
+func (u User) String() string {
+ return fmt.Sprintf(
+ "User{ID:%s, Name:%s, Age:%d, Time:%s}",
+ u.Id, u.Name, u.Age, u.Time,
+ )
}
-type User struct {
- ID string
- Name string
- Age int32
- Time time.Time
+func (u User) JavaClassName() string {
+ return "org.apache.dubbo.User"
}
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()}
span, ctx := opentracing.StartSpanFromContext(ctx, "User-Server-Span")
- time.Sleep(100 * time.Millisecond)
+ gxlog.CInfo("req:%#v", req)
+ user := &User{Id: "001", Name: "zhangsan-dubbogo", Age: 18, Time: time.Now()}
span.Finish()
- gxlog.CInfo("rsp:%#v", rsp)
- return &rsp, nil
+ return user, nil
}
func (u *UserProvider) Reference() string {
return "UserProvider"
}
-
-func (u User) JavaClassName() string {
- return "com.ikurento.user.User"
-}
diff --git a/tracing/dubbo/go-server/profiles/dev/log.yml b/tracing/dubbo/go-server/profiles/dev/log.yml
deleted file mode 100644
index 59fa427..0000000
--- a/tracing/dubbo/go-server/profiles/dev/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-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: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/tracing/dubbo/go-server/profiles/dev/server.yml b/tracing/dubbo/go-server/profiles/dev/server.yml
deleted file mode 100644
index 1fca5e6..0000000
--- a/tracing/dubbo/go-server/profiles/dev/server.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-# dubbo server yaml configure file
-
-filter: "tracing"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info server"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
-
-services:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "dubbo"
- # 相当于dubbo.xml中的interface
- interface : "com.ikurento.user.UserProvider"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "GetUser"
- retries: 1
- loadbalance: "random"
-
-protocols:
- "dubbo":
- name: "dubbo"
- port: 20000
-
-
-protocol_conf:
- dubbo:
- session_number: 700
- session_timeout: "180s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/tracing/dubbo/go-server/profiles/release/log.yml b/tracing/dubbo/go-server/profiles/release/log.yml
deleted file mode 100644
index e0514be..0000000
--- a/tracing/dubbo/go-server/profiles/release/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "warn"
-development: true
-disableCaller: true
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/tracing/dubbo/go-server/profiles/release/server.yml b/tracing/dubbo/go-server/profiles/release/server.yml
deleted file mode 100644
index 72a2964..0000000
--- a/tracing/dubbo/go-server/profiles/release/server.yml
+++ /dev/null
@@ -1,62 +0,0 @@
-# dubbo server yaml configure file
-
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info server"
- version : "0.0.1"
- owner : "ZX"
- environment : "release"
-
-registries :
- "hangzhouzk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-
-services:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "hangzhouzk"
- protocol : "dubbo"
- # 相当于dubbo.xml中的interface
- interface : "com.ikurento.user.UserProvider"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "GetUser"
- retries: 1
- loadbalance: "random"
-
-
-protocols:
- "dubbo":
- name: "dubbo"
- # ip : "127.0.0.1"
- port: 20000
-
-
-protocol_conf:
- dubbo:
- session_number: 700
- session_timeout: "180s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/tracing/dubbo/go-server/profiles/test/log.yml b/tracing/dubbo/go-server/profiles/test/log.yml
deleted file mode 100644
index baee0b7..0000000
--- a/tracing/dubbo/go-server/profiles/test/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "info"
-development: false
-disableCaller: false
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/tracing/dubbo/go-server/profiles/test/server.yml b/tracing/dubbo/go-server/profiles/test/server.yml
deleted file mode 100644
index 4e101f5..0000000
--- a/tracing/dubbo/go-server/profiles/test/server.yml
+++ /dev/null
@@ -1,62 +0,0 @@
-# dubbo server yaml configure file
-
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info server"
- version : "0.0.1"
- owner : "ZX"
- environment : "test"
-
-registries :
- "hangzhouzk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-
-
-services:
- "UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "hangzhouzk"
- protocol : "dubbo"
- # 相当于dubbo.xml中的interface
- interface : "com.ikurento.user.UserProvider"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "GetUser"
- retries: 1
- loadbalance: "random"
-
-protocols:
- "dubbo":
- name: "dubbo"
- # ip : "127.0.0.1"
- port: 20000
-
-
-protocol_conf:
- dubbo:
- session_number: 700
- session_timeout: "180s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/tracing/dubbo/go-server/tests/integration/main_test.go b/tracing/dubbo/go-server/tests/integration/main_test.go
deleted file mode 100644
index ee19ca1..0000000
--- a/tracing/dubbo/go-server/tests/integration/main_test.go
+++ /dev/null
@@ -1,75 +0,0 @@
-// +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"
- "os"
- "testing"
- "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/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/metadata/mapping/memory"
- _ "dubbo.apache.org/dubbo-go/v3/metadata/report/zookeeper"
- _ "dubbo.apache.org/dubbo-go/v3/metadata/service/local"
- _ "dubbo.apache.org/dubbo-go/v3/metadata/service/remote"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/servicediscovery"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
-
- hessian "github.com/apache/dubbo-go-hessian2"
-)
-
-var userProvider = new(UserProvider)
-
-func TestMain(m *testing.M) {
- config.SetConsumerService(userProvider)
- hessian.RegisterPOJO(&User{})
- config.Load()
- time.Sleep(3 * time.Second)
-
- os.Exit(m.Run())
-}
-
-type User struct {
- Id string
- Name string
- Age int32
- 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 "com.ikurento.user.User"
-}
diff --git a/tracing/dubbo/go-server/tests/integration/userprovider_test.go b/tracing/dubbo/go-server/tests/integration/userprovider_test.go
deleted file mode 100644
index 537111f..0000000
--- a/tracing/dubbo/go-server/tests/integration/userprovider_test.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// +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 (
- "dubbo.apache.org/dubbo-go/v3/common/logger"
-
- "github.com/dubbogo/gost/log"
-
- "github.com/opentracing/opentracing-go"
-
- zipkinot "github.com/openzipkin-contrib/zipkin-go-opentracing"
-
- "github.com/openzipkin/zipkin-go"
- zipkinhttp "github.com/openzipkin/zipkin-go/reporter/http"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestGetUser(t *testing.T) {
- initZipkin()
- gxlog.CInfo("\n\n\nstart to test dubbo")
- user := &User{}
- span, ctx := opentracing.StartSpanFromContext(context.Background(), "Test-Client-Service")
- err := userProvider.GetUser(ctx, []interface{}{"A001"}, user)
- span.Finish()
- assert.Nil(t, err)
-
- gxlog.CInfo("response result: %v\n", user)
- //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)
-}
-
-func initZipkin() {
- // set up a span reporter
- reporter := zipkinhttp.NewReporter("http://localhost:9411/api/v2/spans")
-
- // create our local service endpoint
- endpoint, err := zipkin.NewEndpoint("myService", "myservice.mydomain.com:80")
- if err != nil {
- logger.Errorf("unable to create local endpoint: %+v\n", err)
- }
-
- // initialize our tracer
- nativeTracer, err := zipkin.NewTracer(reporter, zipkin.WithLocalEndpoint(endpoint))
- if err != nil {
- logger.Errorf("unable to create tracer: %+v\n", err)
- }
-
- // use zipkin-go-opentracing to wrap our tracer
- tracer := zipkinot.Wrap(nativeTracer)
-
- // optionally set as Global OpenTracing tracer instance
- opentracing.SetGlobalTracer(tracer)
-}
diff --git a/tracing/dubbo/java-client/build.sh b/tracing/dubbo/java-client/build.sh
deleted file mode 100644
index c869acf..0000000
--- a/tracing/dubbo/java-client/build.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-# rm src/main/resources/META-INF/spring/dubbo.consumer.xml
-# cp src/main/resources/META-INF/spring/dubbo-protocol.consumer.xml src/main/resources/META-INF/spring/dubbo.consumer.xml
-# cp src/main/resources/META-INF/spring/jsonrpc-protocol.consumer.xml src/main/resources/META-INF/spring/dubbo.consumer.xml
-mvn clean package -Dmaven.test.skip
diff --git a/tracing/dubbo/java-client/pom.xml b/tracing/dubbo/java-client/pom.xml
deleted file mode 100644
index 4065414..0000000
--- a/tracing/dubbo/java-client/pom.xml
+++ /dev/null
@@ -1,230 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.ikurento</groupId>
- <artifactId>user-info-client</artifactId>
- <packaging>jar</packaging>
- <version>0.2.0</version>
- <description>The demo consumer module of dubbo project</description>
-
- <properties>
- <skip_maven_deploy>false</skip_maven_deploy>
-
- <dubbo-jsonrpc-version>1.0.1</dubbo-jsonrpc-version>
- <dubbo-version>2.6.5</dubbo-version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo-dependencies-bom</artifactId>
- <version>${dubbo-version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>com.qianmi</groupId>
- <artifactId>dubbo-rpc-jsonrpc</artifactId>
- <version>${dubbo-jsonrpc-version}</version>
- </dependency>
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo</artifactId>
- <version>${dubbo-version}</version>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>2.12.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.20.0-GA</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.netty</groupId>
- <artifactId>netty</artifactId>
- <version>3.2.5.Final</version>
- </dependency>
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-core</artifactId>
- <version>1.1.7</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.grizzly</groupId>
- <artifactId>grizzly-core</artifactId>
- <version>2.1.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.5.7</version>
- </dependency>
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>fastjson</artifactId>
- <version>1.2.56</version>
- </dependency>
- <dependency>
- <groupId>com.thoughtworks.xstream</groupId>
- <artifactId>xstream</artifactId>
- <version>1.4.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-api</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>3.4.14</version>
- </dependency>
- <dependency>
- <groupId>com.github.sgroschupf</groupId>
- <artifactId>zkclient</artifactId>
- <version>0.1</version>
- </dependency>
- <dependency>
- <groupId>com.netflix.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>1.1.16</version>
- </dependency>
- <dependency>
- <groupId>com.googlecode.xmemcached</groupId>
- <artifactId>xmemcached</artifactId>
- <version>1.3.6</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-simple</artifactId>
- <version>2.6.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http</artifactId>
- <version>2.6.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.thrift</groupId>
- <artifactId>libthrift</artifactId>
- <version>0.12.0</version>
- </dependency>
- <dependency>
- <groupId>com.caucho</groupId>
- <artifactId>hessian</artifactId>
- <version>4.0.7</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>6.1.26</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.16</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.2</version>
- </dependency>
- <dependency>
- <groupId>redis.clients</groupId>
- <artifactId>jedis</artifactId>
- <version>2.1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- <version>1.0.0.GA</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>4.2.0.Final</version>
- </dependency>
- <dependency>
- <groupId>javax.cache</groupId>
- <artifactId>cache-api</artifactId>
- <version>0.4</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>package</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo</artifactId>
- <version>${dubbo-version}</version>
- <outputDirectory>${project.build.directory}/dubbo</outputDirectory>
- <includes>META-INF/assembly/**</includes>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptor>src/main/assembly/assembly.xml</descriptor>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/tracing/dubbo/java-client/src/main/assembly/assembly.xml b/tracing/dubbo/java-client/src/main/assembly/assembly.xml
deleted file mode 100644
index bc00a06..0000000
--- a/tracing/dubbo/java-client/src/main/assembly/assembly.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-<assembly>
- <id>assembly</id>
- <formats>
- <format>tar.gz</format>
- </formats>
- <includeBaseDirectory>true</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>${project.build.directory}/dubbo/META-INF/assembly/bin</directory>
- <outputDirectory>bin</outputDirectory>
- <fileMode>0755</fileMode>
- </fileSet>
- <fileSet>
- <directory>src/main/resources</directory>
- <includes>
- <include>dubbo.properties</include>
- <include>log4j.*</include>
- </includes>
- <outputDirectory>conf</outputDirectory>
- <fileMode>0644</fileMode>
- </fileSet>
- </fileSets>
- <dependencySets>
- <dependencySet>
- <outputDirectory>lib</outputDirectory>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
diff --git a/tracing/dubbo/java-client/src/main/java/com/ikurento/user/Consumer.java b/tracing/dubbo/java-client/src/main/java/com/ikurento/user/Consumer.java
deleted file mode 100644
index 9635d88..0000000
--- a/tracing/dubbo/java-client/src/main/java/com/ikurento/user/Consumer.java
+++ /dev/null
@@ -1,60 +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 com.ikurento.user;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-
-public class Consumer {
- // Define a private variable (Required in Spring)
- private UserProvider userProvider;
-
- // Spring DI (Required in Spring)
- public void setUserProvider(UserProvider u) {
- this.userProvider = u;
- }
-
- public static void main(String[] args) {
- ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("META-INF/spring/dubbo.consumer.xml","META-INF/spring/service.xml");
- context.start();
- context.getBean(Consumer.class).start();
- }
-
- // Start the entry function for consumer (Specified in the configuration file)
- public void start() {
- System.out.println("\n\ntest");
- testGetUser();
- }
-
- private void testGetUser() {
- try {
- User user1 = userProvider.GetUser("A003");
- System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] " +
- " UserInfo, ID:" + user1.getID() + ", name:" + user1.getName()
- + ", age:" + user1.getAge() + ", time:" + user1.getTime().toString());
-
- } catch (Exception e) {
- System.out.println("*************exception***********");
- e.printStackTrace();
- }
- }
-
-}
diff --git a/tracing/dubbo/java-client/src/main/java/com/ikurento/user/User.java b/tracing/dubbo/java-client/src/main/java/com/ikurento/user/User.java
deleted file mode 100644
index 666e904..0000000
--- a/tracing/dubbo/java-client/src/main/java/com/ikurento/user/User.java
+++ /dev/null
@@ -1,76 +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 com.ikurento.user;
-
-import java.util.Date;
-
-public class User {
-
- private String id;
-
- private String name;
-
- private int age;
-
- private Date time = new Date();
-
-
- public User() {
- }
-
-
- public User(String id, String name, int age) {
- this.id = id;
- this.name = name;
- this.age = age;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public int getAge() {
- return age;
- }
-
- public void setAge(int age) {
- this.age = age;
- }
-
- public Date getTime() {
- return time;
- }
-
- public void setTime(Date time) {
- this.time = time;
- }
-
-
-}
diff --git a/tracing/dubbo/java-client/src/main/java/com/ikurento/user/UserProvider.java b/tracing/dubbo/java-client/src/main/java/com/ikurento/user/UserProvider.java
deleted file mode 100644
index 67a836a..0000000
--- a/tracing/dubbo/java-client/src/main/java/com/ikurento/user/UserProvider.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Licensed 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 com.ikurento.user;
-
-public interface UserProvider {
- User GetUser(String userId);
-}
diff --git a/tracing/dubbo/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml b/tracing/dubbo/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml
deleted file mode 100644
index 8e8e84d..0000000
--- a/tracing/dubbo/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
-
-
- <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 -->
- <dubbo:application name="user-info-client" />
- <!-- 连接到哪个本地注册中心 -->
- <dubbo:registry id="ikurento" address="zookeeper://127.0.0.1:2181" />
- <!-- dubbo.registry.address from dubbo.properties -->
- <!-- dubbo:registry address="${dubbo.registry.address}" / -->
-
- <!-- 用dubbo协议在20880端口暴露服务 -->
- <dubbo:protocol id="dubbo" name="dubbo" />
- <dubbo:protocol id="jsonrpc" name="jsonrpc" />
-
- <!-- 声明需要使用的服务接口 -->
- <dubbo:reference registry="ikurento" check="false" id="userProvider" protocol="dubbo" interface="com.ikurento.user.UserProvider">
- <!--<dubbo:parameter key="heartbeat" value="10000"/ -->
- </dubbo:reference>
-</beans>
diff --git a/tracing/dubbo/java-client/src/main/resources/META-INF/spring/service.xml b/tracing/dubbo/java-client/src/main/resources/META-INF/spring/service.xml
deleted file mode 100644
index 529f63e..0000000
--- a/tracing/dubbo/java-client/src/main/resources/META-INF/spring/service.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
-
- <bean class="com.ikurento.user.Consumer" init-method="start">
- <!-- 声明这个类 要使用的服务名-->
- <property name="userProvider" ref="userProvider" />
- </bean>
-
-</beans>
diff --git a/tracing/dubbo/java-client/src/main/resources/dubbo.properties b/tracing/dubbo/java-client/src/main/resources/dubbo.properties
deleted file mode 100644
index e561efc..0000000
--- a/tracing/dubbo/java-client/src/main/resources/dubbo.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-### dubboע���������� ###
-dubbo.container = log4j,spring
-dubbo.application.name = user-info-client
-dubbo.application.owner = AlexStocks
-dubbo.application.environment = product
-dubbo.registry.address = zookeeper://127.0.0.1:2181
-dubbo.monitor.protocol = zookeeper
-dubbo.consumer.timeout = 10000
-dubbo.provider.timeout = 10000
-dubbo.protocol.name = dubbo
-
-dubbo.log4j.file = logs/client.log
-dubbo.log4j.level = WARN
diff --git a/tracing/dubbo/java-client/src/main/resources/log4j.properties b/tracing/dubbo/java-client/src/main/resources/log4j.properties
deleted file mode 100644
index 06bcb34..0000000
--- a/tracing/dubbo/java-client/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-## Logger configure file for myproject
-log.dir=logs/
-datestamp=yyyy-MM-dd/HH:mm:ss.SSS
-
-log4j.rootLogger=DEBUG, file, console
-
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.threshold=DEBUG
-log4j.appender.file.File=${log.dir}/log4j.log
-log4j.appender.file.DatePattern=-yyyyMMddHH
-log4j.appender.file.ImmediateFlush=true
-log4j.appender.file.Append=true
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=DEBUG
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
diff --git a/tracing/dubbo/java-server/build.sh b/tracing/dubbo/java-server/build.sh
deleted file mode 100644
index 7b5755b..0000000
--- a/tracing/dubbo/java-server/build.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-# mvn dependency:sources
-mvn clean package -Dmaven.test.skip
-# mvn -X clean compile package -DskipTests=true
diff --git a/tracing/dubbo/java-server/pom.xml b/tracing/dubbo/java-server/pom.xml
deleted file mode 100644
index 962edfd..0000000
--- a/tracing/dubbo/java-server/pom.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.ikurento</groupId>
- <artifactId>user-info-server</artifactId>
- <packaging>jar</packaging>
- <version>0.2.0</version>
- <description>The demo provider module of dubbo project</description>
- <properties>
- <skip_maven_deploy>false</skip_maven_deploy>
-
- <dubbo-version>2.6.5</dubbo-version>
- <dubbo-jsonrpc-version>1.0.1</dubbo-jsonrpc-version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo-dependencies-bom</artifactId>
- <version>${dubbo-version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.25</version>
- </dependency>
-
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo</artifactId>
- <version>${dubbo-version}</version>
- <exclusions>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>2.12.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.qianmi</groupId>
- <artifactId>dubbo-rpc-jsonrpc</artifactId>
- <version>${dubbo-jsonrpc-version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>6.1.26</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>2.10.0</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.10.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.github.sgroschupf</groupId>
- <artifactId>zkclient</artifactId>
- <version>0.1</version>
- <exclusions>
- <exclusion>
- <artifactId>org.apache.zookeeper</artifactId>
- <groupId>zookeeper</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>3.4.14</version>
- </dependency>
-
- </dependencies>
-
- <repositories>
- <repository>
- <id>nexus-aliyu</id>
- <url>http://maven.aliyun.com/nexus/content/groups/public</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>nexus-aliyu</id>
- <url>http://maven.aliyun.com/nexus/content/groups/public</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
-
- <build>
-
- <plugins>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>package</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo</artifactId>
- <version>${dubbo-version}</version>
- <outputDirectory>${project.build.directory}/dubbo</outputDirectory>
- <includes>META-INF/assembly/**</includes>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/assembly.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-
-</project>
-
-
diff --git a/tracing/dubbo/java-server/script/debug.sh b/tracing/dubbo/java-server/script/debug.sh
deleted file mode 100644
index 851957a..0000000
--- a/tracing/dubbo/java-server/script/debug.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-# jdb -classpath /Users/alex/tmp/us/conf:/Users/alex/tmp/us/lib/*:/Users/alex/test/java/dubbo/2.5.4/dubbo-remoting/dubbo-remoting-api/src/main/java/ com.alibaba.dubbo.container.Main
-jdb -classpath /Users/alex/tmp/us/conf:/Users/alex/tmp/us/lib/* -sourcepath /Users/alex/test/java/dubbo/2.5.4/dubbo-remoting/dubbo-remoting-api/src/main/java/:/Users/alex/tmp/java-server/src/main/java com.alibaba.dubbo.container.Main
-# jdb stop at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec:76
-# run
-
diff --git a/tracing/dubbo/java-server/src/main/assembly/assembly.xml b/tracing/dubbo/java-server/src/main/assembly/assembly.xml
deleted file mode 100644
index 5b4075c..0000000
--- a/tracing/dubbo/java-server/src/main/assembly/assembly.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-<assembly>
- <id>assembly</id>
- <formats>
- <format>tar.gz</format>
- </formats>
- <includeBaseDirectory>true</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>${project.build.directory}/dubbo/META-INF/assembly/bin</directory>
- <outputDirectory>bin</outputDirectory>
- <fileMode>0755</fileMode>
- <directoryMode>0755</directoryMode>
- </fileSet>
- <fileSet>
- <directory>src/main/resources</directory>
- <includes>
- <include>dubbo.properties</include>
- <include>log4j.*</include>
- </includes>
- <outputDirectory>conf</outputDirectory>
- <fileMode>0644</fileMode>
- <directoryMode>0755</directoryMode>
- </fileSet>
- </fileSets>
- <dependencySets>
- <dependencySet>
- <outputDirectory>lib</outputDirectory>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
diff --git a/tracing/dubbo/java-server/src/main/java/com/ikurento/user/Provider.java b/tracing/dubbo/java-server/src/main/java/com/ikurento/user/Provider.java
deleted file mode 100644
index 0031f55..0000000
--- a/tracing/dubbo/java-server/src/main/java/com/ikurento/user/Provider.java
+++ /dev/null
@@ -1,33 +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 com.ikurento.user;
-
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class Provider {
-
- /**
- * To get ipv6 address to work, add
- * System.setProperty("java.net.preferIPv6Addresses", "true");
- * before running your application.
- */
- public static void main(String[] args) throws Exception {
- ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/dubbo.provider.xml"});
- context.start();
- System.in.read(); // press any key to exit
- }
-}
diff --git a/tracing/dubbo/java-server/src/main/java/com/ikurento/user/User.java b/tracing/dubbo/java-server/src/main/java/com/ikurento/user/User.java
deleted file mode 100644
index fd2cafb..0000000
--- a/tracing/dubbo/java-server/src/main/java/com/ikurento/user/User.java
+++ /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 com.ikurento.user;
-
-import java.util.Date;
-import java.io.Serializable;
-
-public class User implements Serializable {
-
- private String id;
-
- private String name;
-
- private int age;
-
- private Date time = new Date();
-
- public User() {
- }
-
- public User(String id, String name, int age) {
- this.id = id;
- this.name = name;
- this.age = age;
- }
-
- public User(String id, String name, int age, Date time) {
- this.id = id;
- this.name = name;
- this.age = age;
- this.time = time;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public int getAge() {
- return age;
- }
-
- public void setAge(int age) {
- this.age = age;
- }
-
- public Date getTime() {
- return time;
- }
-
- public void setTime(Date time) {
- this.time = time;
- }
-
-
-
- public String toString() {
- return "User{id:" + id + ", name:" + name + ", age:" + age + ", time:" + time +"}";
- }
-}
diff --git a/tracing/dubbo/java-server/src/main/java/com/ikurento/user/UserProvider.java b/tracing/dubbo/java-server/src/main/java/com/ikurento/user/UserProvider.java
deleted file mode 100644
index b1eeab8..0000000
--- a/tracing/dubbo/java-server/src/main/java/com/ikurento/user/UserProvider.java
+++ /dev/null
@@ -1,24 +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 com.ikurento.user;
-
-public interface UserProvider {
-
- User GetUser(String userId); // the first alpha is Upper case to compatible with golang.
-
-}
diff --git a/tracing/dubbo/java-server/src/main/java/com/ikurento/user/UserProviderImpl.java b/tracing/dubbo/java-server/src/main/java/com/ikurento/user/UserProviderImpl.java
deleted file mode 100644
index 0d66c43..0000000
--- a/tracing/dubbo/java-server/src/main/java/com/ikurento/user/UserProviderImpl.java
+++ /dev/null
@@ -1,30 +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 com.ikurento.user;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class UserProviderImpl implements UserProvider {
- private static final Logger LOG = LoggerFactory.getLogger("UserLogger"); //Output to user-server.log
-
- public User GetUser(String userId) {
- return new User(userId, "zhangsan", 18);
- }
-
-}
diff --git a/tracing/dubbo/java-server/src/main/resources/META-INF/spring/dubbo.provider.xml b/tracing/dubbo/java-server/src/main/resources/META-INF/spring/dubbo.provider.xml
deleted file mode 100644
index 3fca067..0000000
--- a/tracing/dubbo/java-server/src/main/resources/META-INF/spring/dubbo.provider.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
-
- <!-- 应用名 -->
- <dubbo:application name="user-info-server"/>
- <!-- 连接到哪个本地注册中心 -->
- <dubbo:registry id="ikurento" address="zookeeper://127.0.0.1:2181" />
- <!-- 用dubbo协议在20880端口暴露服务 -->
- <!-- dubbo:protocol host="127.0.0.1" / -->
- <dubbo:protocol id="dubbo" name="dubbo" host="127.0.0.1" port="20010" />
- <!-- 声明需要暴露的服务接口 -->
- <dubbo:service id="aaa" registry="ikurento" timeout="3000" interface="com.ikurento.user.UserProvider" ref="demoService"/>
-
- <bean id="demoService" class="com.ikurento.user.UserProviderImpl" />
-
-</beans>
diff --git a/tracing/dubbo/java-server/src/main/resources/dubbo.properties b/tracing/dubbo/java-server/src/main/resources/dubbo.properties
deleted file mode 100644
index 2826f31..0000000
--- a/tracing/dubbo/java-server/src/main/resources/dubbo.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-### dubbo注册中心配置 ##
-dubbo.container = log4j,spring
-dubbo.application.name = user-info-server
-dubbo.application.environment = product
-dubbo.application.owner = AlexStocks
-dubbo.registry.address = 127.0.0.1:2181
-dubbo.registry.protocol = zookeeper
-dubbo.consumer.timeout = 10000
-dubbo.provider.timeout = 10000
-dubbo.protocol.name = dubbo
-dubbo.protocol.port = 10000
-
-dubbo.log4j.file = logs/dubbo.log
-dubbo.log4j.level = INFO
diff --git a/tracing/dubbo/java-server/src/main/resources/log4j.properties b/tracing/dubbo/java-server/src/main/resources/log4j.properties
deleted file mode 100644
index 13c8049..0000000
--- a/tracing/dubbo/java-server/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-## Logger configure file for myproject
-log.dir=logs/
-datestamp=yyyy-MM-dd/HH:mm:ss.SSS
-
-log4j.rootLogger=DEBUG, file, console
-
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.threshold=DEBUG
-log4j.appender.file.File=${log.dir}/log4j.log
-log4j.appender.file.DatePattern=-yyyyMMddHH
-log4j.appender.file.ImmediateFlush=true
-log4j.appender.file.Append=true
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=DEBUG
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
-