Router example enhance (#89)
* enhance router_config.yaml
* enhance tag router example
* enhance tag examples
diff --git a/router/condition/go-client/conf/router_config.yml b/router/condition/go-client/conf/router_config.yml
index fdf0333..af0abd6 100644
--- a/router/condition/go-client/conf/router_config.yml
+++ b/router/condition/go-client/conf/router_config.yml
@@ -4,10 +4,10 @@
key: UserInfoTest
priority: 1
force: true
- conditions: [ "host = $HOST_IP => host = $HOST_IP " ]
+ conditions: [ "host = $HOST_IP => host != $HOST_IP" ]
- scope: service
key: org.apache.dubbo.UserProvider
priority: 1
force: true
conditions:
- - method = GetUser => host = 1.2.3.4
\ No newline at end of file
+ - method = GetUser => host = $HOST_IP
\ No newline at end of file
diff --git a/router/condition/go-server/conf/router_config.yml b/router/condition/go-server/conf/router_config.yml
index fdf0333..915d9ba 100644
--- a/router/condition/go-server/conf/router_config.yml
+++ b/router/condition/go-server/conf/router_config.yml
@@ -4,10 +4,10 @@
key: UserInfoTest
priority: 1
force: true
- conditions: [ "host = $HOST_IP => host = $HOST_IP " ]
+ conditions: [ "host = $HOST_IP => host == $HOST_IP" ]
- scope: service
key: org.apache.dubbo.UserProvider
priority: 1
force: true
conditions:
- - method = GetUser => host = 1.2.3.4
\ No newline at end of file
+ - method = GetUser => host != $HOST_IP
\ No newline at end of file
diff --git a/router/tag/go-server/conf/router_config.yml b/router/tag/go-server/conf/router_config.yml
index fb8a9e6..68cd6d0 100644
--- a/router/tag/go-server/conf/router_config.yml
+++ b/router/tag/go-server/conf/router_config.yml
@@ -9,6 +9,6 @@
key: demo-provider
tags:
- name: beijing
- addresses: [192.168.1.1, $HOST_IP]
+ addresses: [192.168.1.1, 1.2.3.4]
- name: shenzhen
addresses: [192.168.1.3, 192.168.1.4]
\ No newline at end of file
diff --git a/router/tag/go-server/tests/integration/main_test.go b/router/tag/go-server/tests/integration/main_test.go
index 758cc00..8d37927 100644
--- a/router/tag/go-server/tests/integration/main_test.go
+++ b/router/tag/go-server/tests/integration/main_test.go
@@ -21,10 +21,9 @@
import (
hessian "github.com/apache/dubbo-go-hessian2"
-
_ "github.com/apache/dubbo-go/cluster/cluster_impl"
_ "github.com/apache/dubbo-go/cluster/loadbalance"
- _ "github.com/apache/dubbo-go/cluster/router/condition"
+ _ "github.com/apache/dubbo-go/cluster/router/tag"
_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
"github.com/apache/dubbo-go/config"
_ "github.com/apache/dubbo-go/filter/filter_impl"
@@ -46,7 +45,7 @@
config.SetConsumerService(userProvider)
hessian.RegisterPOJO(&User{})
config.Load()
- time.Sleep(6 * time.Second)
+ time.Sleep(10 * time.Second)
os.Exit(m.Run())
}