You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by il...@apache.org on 2020/10/27 03:25:03 UTC
[dubbo-go-samples] branch makefile updated: enhance config and
package name
This is an automated email from the ASF dual-hosted git repository.
iluo pushed a commit to branch makefile
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
The following commit(s) were added to refs/heads/makefile by this push:
new 4f72d63 enhance config and package name
4f72d63 is described below
commit 4f72d63b1105be4b9d7ab00a4693d29ea3c012af
Author: Ian Luo <ia...@gmail.com>
AuthorDate: Tue Oct 27 11:23:08 2020 +0800
enhance config and package name
---
helloworld/dubbo/go-server/cmd/server.go | 4 ----
helloworld/dubbo/go-server/conf/client.yml | 16 +++++++---------
helloworld/dubbo/go-server/conf/log.yml | 2 +-
helloworld/dubbo/go-server/conf/server.yml | 16 +++++++---------
helloworld/dubbo/go-server/pkg/user.go | 2 +-
.../dubbo/go-server/tests/integration/main_test.go | 2 +-
6 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/helloworld/dubbo/go-server/cmd/server.go b/helloworld/dubbo/go-server/cmd/server.go
index 5c0c2c3..db85a0c 100644
--- a/helloworld/dubbo/go-server/cmd/server.go
+++ b/helloworld/dubbo/go-server/cmd/server.go
@@ -45,11 +45,7 @@ var (
survivalTimeout = int(3e9)
)
-// The following environment variables are required:
-// export CONF_PROVIDER_FILE_PATH="xxx"
-// export APP_LOG_CONF_FILE="xxx"
func main() {
-
hessian.RegisterPOJO(&pkg.User{})
config.Load()
diff --git a/helloworld/dubbo/go-server/conf/client.yml b/helloworld/dubbo/go-server/conf/client.yml
index 55bc924..3d8870f 100644
--- a/helloworld/dubbo/go-server/conf/client.yml
+++ b/helloworld/dubbo/go-server/conf/client.yml
@@ -1,6 +1,5 @@
# dubbo client yaml configure file
-
check: true
# client
request_timeout : "3s"
@@ -9,13 +8,13 @@ connect_timeout : "3s"
# application config
application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info client"
+ organization : "dubbo.io"
+ name : "UserInfoServer"
+ module : "dubbo-go user-info client"
version : "0.0.1"
- owner : "ZX"
environment : "dev"
+# registry config
registries :
"demoZk":
protocol: "zookeeper"
@@ -24,19 +23,18 @@ registries :
username: ""
password: ""
-
+# reference config
references:
"UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
registry: "demoZk"
protocol : "dubbo"
- interface : "com.ikurento.user.UserProvider"
+ interface : "org.apache.dubbo.UserProvider"
cluster: "failover"
methods :
- name: "GetUser"
retries: 3
-
+# protocol config
protocol_conf:
dubbo:
reconnect_interval: 0
diff --git a/helloworld/dubbo/go-server/conf/log.yml b/helloworld/dubbo/go-server/conf/log.yml
index 3ed242d..d0400fe 100644
--- a/helloworld/dubbo/go-server/conf/log.yml
+++ b/helloworld/dubbo/go-server/conf/log.yml
@@ -15,7 +15,7 @@ encoderConfig:
callerKey: "caller"
stacktraceKey: "stacktrace"
lineEnding: ""
- levelEncoder: "capitalColor"
+ levelEncoder: "capital"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
diff --git a/helloworld/dubbo/go-server/conf/server.yml b/helloworld/dubbo/go-server/conf/server.yml
index b9f1da6..6e8970c 100644
--- a/helloworld/dubbo/go-server/conf/server.yml
+++ b/helloworld/dubbo/go-server/conf/server.yml
@@ -1,28 +1,26 @@
# dubbo server yaml configure file
-
# application config
application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo user-info server"
+ organization : "dubbo.io"
+ name : "UserInfoServer"
+ module : "dubbo-go user-info server"
version : "0.0.1"
- owner : "ZX"
environment : "dev"
+# registry config
registries :
"demoZk":
protocol: "zookeeper"
timeout : "3s"
address: "127.0.0.1:2181"
+# service config
services:
"UserProvider":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
registry: "demoZk"
protocol : "dubbo"
- # 相当于dubbo.xml中的interface
- interface : "com.ikurento.user.UserProvider"
+ interface : "org.apache.dubbo.UserProvider"
loadbalance: "random"
warmup: "100"
cluster: "failover"
@@ -31,12 +29,12 @@ services:
retries: 1
loadbalance: "random"
+# protocol config
protocols:
"dubbo":
name: "dubbo"
port: 20000
-
protocol_conf:
dubbo:
session_number: 700
diff --git a/helloworld/dubbo/go-server/pkg/user.go b/helloworld/dubbo/go-server/pkg/user.go
index 0cea3e3..37fcb25 100644
--- a/helloworld/dubbo/go-server/pkg/user.go
+++ b/helloworld/dubbo/go-server/pkg/user.go
@@ -59,5 +59,5 @@ func (u *UserProvider) Reference() string {
}
func (u User) JavaClassName() string {
- return "com.ikurento.user.User"
+ return "org.apache.dubbo.User"
}
diff --git a/helloworld/dubbo/go-server/tests/integration/main_test.go b/helloworld/dubbo/go-server/tests/integration/main_test.go
index 13586c8..3aefa29 100644
--- a/helloworld/dubbo/go-server/tests/integration/main_test.go
+++ b/helloworld/dubbo/go-server/tests/integration/main_test.go
@@ -58,5 +58,5 @@ func (u *UserProvider) Reference() string {
}
func (User) JavaClassName() string {
- return "com.ikurento.user.User"
+ return "org.apache.dubbo.User"
}