diff --git a/.gitignore b/.gitignore index f369c2833aeacbff3aa85a6cd1cdc25520928209..e5ba291004ab0d89c1ef1db6f353361232fddcc8 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ coverage.txt remoting/zookeeper/zookeeper-4unittest/ config_center/zookeeper/zookeeper-4unittest/ registry/zookeeper/zookeeper-4unittest/ +registry/consul/agent* \ No newline at end of file diff --git a/README.md b/README.md index 694f0091533f644b58438c6487dc53348add6e60..b54568ce0317a443d56b1d6d437e5f43334013bd 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ Finished List: * [AccessLogFilter](https://github.com/apache/dubbo-go/pull/214) * [TpsLimitFilter](https://github.com/apache/dubbo-go/pull/237) * [ExecuteLimitFilter](https://github.com/apache/dubbo-go/pull/246) + * [GenericServiceFilter](https://github.com/apache/dubbo-go/pull/291) - Invoke * [generic invoke](https://github.com/apache/dubbo-go/pull/122) diff --git a/cluster/router/condition_router.go b/cluster/router/condition_router.go index efae65ccb34eb8a78e281cfaf7b1fcec79b3d163..ff1537fc71ec0aa5257cd14b49d514f15d86556a 100644 --- a/cluster/router/condition_router.go +++ b/cluster/router/condition_router.go @@ -24,7 +24,7 @@ import ( ) import ( - "github.com/dubbogo/gost/container/gxset" + gxset "github.com/dubbogo/gost/container/set" gxnet "github.com/dubbogo/gost/net" perrors "github.com/pkg/errors" ) diff --git a/common/constant/version.go b/common/constant/version.go index d4c6821e76894cbd82dc5fae09124263b5c6aa0f..8ef9fae2c6088e78007abf8f7ddd81cc363c4ec3 100644 --- a/common/constant/version.go +++ b/common/constant/version.go @@ -18,7 +18,7 @@ package constant const ( - Version = "2.6.0" + Version = "1.3.0" Name = "dubbogo" - DATE = "2019/05/06" + DATE = "2020/01/12" ) diff --git a/common/url.go b/common/url.go index c010298bf58d65b6c2fcfc7859e03b0131bf7f54..7a854293142bb237df7faa0a081104bfabdd0bb4 100644 --- a/common/url.go +++ b/common/url.go @@ -31,7 +31,7 @@ import ( ) import ( - "github.com/dubbogo/gost/container/gxset" + gxset "github.com/dubbogo/gost/container/set" "github.com/jinzhu/copier" perrors "github.com/pkg/errors" "github.com/satori/go.uuid" @@ -523,7 +523,7 @@ func MergeUrl(serviceUrl *URL, referenceUrl *URL) *URL { return true }) //loadBalance,cluster,retries strategy config - methodConfigMergeFcn := mergeNormalParam(mergedUrl, referenceUrl, []string{constant.LOADBALANCE_KEY, constant.CLUSTER_KEY, constant.RETRIES_KEY}) + methodConfigMergeFcn := mergeNormalParam(mergedUrl, referenceUrl, []string{constant.LOADBALANCE_KEY, constant.CLUSTER_KEY, constant.RETRIES_KEY, constant.TIMEOUT_KEY}) //remote timestamp if v := serviceUrl.GetParam(constant.TIMESTAMP_KEY, ""); len(v) > 0 { diff --git a/common/url_test.go b/common/url_test.go index 4d60d7f13f5d139e964b0837380f1054871c5d15..c70c58bc215b6449311d43f9f9cffeb89623f80c 100644 --- a/common/url_test.go +++ b/common/url_test.go @@ -239,7 +239,7 @@ func TestMergeUrl(t *testing.T) { serviceUrlParams.Set("test2", "1") serviceUrlParams.Set(constant.CLUSTER_KEY, "roundrobin") serviceUrlParams.Set(constant.RETRIES_KEY, "2") - serviceUrlParams.Set("methods.testMethod."+constant.RETRIES_KEY, "2") + serviceUrlParams.Set(constant.METHOD_KEYS+".testMethod."+constant.RETRIES_KEY, "2") referenceUrl, _ := NewURL(context.TODO(), "mock1://127.0.0.1:1111", WithParams(referenceUrlParams), WithMethods([]string{"testMethod"})) serviceUrl, _ := NewURL(context.TODO(), "mock2://127.0.0.1:20000", WithParams(serviceUrlParams)) @@ -248,7 +248,7 @@ func TestMergeUrl(t *testing.T) { assert.Equal(t, "1", mergedUrl.GetParam("test2", "")) assert.Equal(t, "1", mergedUrl.GetParam("test3", "")) assert.Equal(t, "1", mergedUrl.GetParam(constant.RETRIES_KEY, "")) - assert.Equal(t, "1", mergedUrl.GetParam("methods.testMethod."+constant.RETRIES_KEY, "")) + assert.Equal(t, "2", mergedUrl.GetParam(constant.METHOD_KEYS+".testMethod."+constant.RETRIES_KEY, "")) } func TestURL_SetParams(t *testing.T) { diff --git a/config/graceful_shutdown.go b/config/graceful_shutdown.go index fedb2c15ecdab62d17f0a4e83c45522f1c18acb0..83e2589c7b2869a5822c5e90de1699b3bd27df92 100644 --- a/config/graceful_shutdown.go +++ b/config/graceful_shutdown.go @@ -25,7 +25,7 @@ import ( ) import ( - "github.com/dubbogo/gost/container/gxset" + gxset "github.com/dubbogo/gost/container/set" ) import ( diff --git a/config/method_config.go b/config/method_config.go index 876abeeae0c7d37070c5938107d1bb1dd5dbbaa9..e10548e667e6a16d33690f011ebc9958af1eea71 100644 --- a/config/method_config.go +++ b/config/method_config.go @@ -37,6 +37,7 @@ type MethodConfig struct { ExecuteLimit string `yaml:"execute.limit" json:"execute.limit,omitempty" property:"execute.limit"` ExecuteLimitRejectedHandler string `yaml:"execute.limit.rejected.handler" json:"execute.limit.rejected.handler,omitempty" property:"execute.limit.rejected.handler"` Sticky bool `yaml:"sticky" json:"sticky,omitempty" property:"sticky"` + RequestTimeout string `yaml:"timeout" json:"timeout,omitempty" property:"timeout"` } func (c *MethodConfig) Prefix() string { diff --git a/config/reference_config.go b/config/reference_config.go index 780133327df3b52c601ceed3700bcc4e363d009f..65bbfd2b31998b7a8f06b0721264d52333c4cd2f 100644 --- a/config/reference_config.go +++ b/config/reference_config.go @@ -40,27 +40,28 @@ import ( ) type ReferenceConfig struct { - context context.Context - pxy *proxy.Proxy - id string - InterfaceName string `required:"true" yaml:"interface" json:"interface,omitempty" property:"interface"` - Check *bool `yaml:"check" json:"check,omitempty" property:"check"` - Url string `yaml:"url" json:"url,omitempty" property:"url"` - Filter string `yaml:"filter" json:"filter,omitempty" property:"filter"` - Protocol string `default:"dubbo" yaml:"protocol" json:"protocol,omitempty" property:"protocol"` - Registry string `yaml:"registry" json:"registry,omitempty" property:"registry"` - Cluster string `yaml:"cluster" json:"cluster,omitempty" property:"cluster"` - Loadbalance string `yaml:"loadbalance" json:"loadbalance,omitempty" property:"loadbalance"` - Retries string `yaml:"retries" json:"retries,omitempty" property:"retries"` - Group string `yaml:"group" json:"group,omitempty" property:"group"` - Version string `yaml:"version" json:"version,omitempty" property:"version"` - Methods []*MethodConfig `yaml:"methods" json:"methods,omitempty" property:"methods"` - Async bool `yaml:"async" json:"async,omitempty" property:"async"` - Params map[string]string `yaml:"params" json:"params,omitempty" property:"params"` - invoker protocol.Invoker - urls []*common.URL - Generic bool `yaml:"generic" json:"generic,omitempty" property:"generic"` - Sticky bool `yaml:"sticky" json:"sticky,omitempty" property:"sticky"` + context context.Context + pxy *proxy.Proxy + id string + InterfaceName string `required:"true" yaml:"interface" json:"interface,omitempty" property:"interface"` + Check *bool `yaml:"check" json:"check,omitempty" property:"check"` + Url string `yaml:"url" json:"url,omitempty" property:"url"` + Filter string `yaml:"filter" json:"filter,omitempty" property:"filter"` + Protocol string `default:"dubbo" yaml:"protocol" json:"protocol,omitempty" property:"protocol"` + Registry string `yaml:"registry" json:"registry,omitempty" property:"registry"` + Cluster string `yaml:"cluster" json:"cluster,omitempty" property:"cluster"` + Loadbalance string `yaml:"loadbalance" json:"loadbalance,omitempty" property:"loadbalance"` + Retries string `yaml:"retries" json:"retries,omitempty" property:"retries"` + Group string `yaml:"group" json:"group,omitempty" property:"group"` + Version string `yaml:"version" json:"version,omitempty" property:"version"` + Methods []*MethodConfig `yaml:"methods" json:"methods,omitempty" property:"methods"` + Async bool `yaml:"async" json:"async,omitempty" property:"async"` + Params map[string]string `yaml:"params" json:"params,omitempty" property:"params"` + invoker protocol.Invoker + urls []*common.URL + Generic bool `yaml:"generic" json:"generic,omitempty" property:"generic"` + Sticky bool `yaml:"sticky" json:"sticky,omitempty" property:"sticky"` + RequestTimeout string `yaml:"timeout" json:"timeout,omitempty" property:"timeout"` } func (c *ReferenceConfig) Prefix() string { @@ -174,6 +175,9 @@ func (refconfig *ReferenceConfig) getUrlMap() url.Values { urlMap.Set(constant.VERSION_KEY, refconfig.Version) urlMap.Set(constant.GENERIC_KEY, strconv.FormatBool(refconfig.Generic)) urlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER)) + if len(refconfig.RequestTimeout) != 0 { + urlMap.Set(constant.TIMEOUT_KEY, refconfig.RequestTimeout) + } //getty invoke async or sync urlMap.Set(constant.ASYNC_KEY, strconv.FormatBool(refconfig.Async)) urlMap.Set(constant.STICKY_KEY, strconv.FormatBool(refconfig.Sticky)) @@ -198,6 +202,9 @@ func (refconfig *ReferenceConfig) getUrlMap() url.Values { urlMap.Set("methods."+v.Name+"."+constant.LOADBALANCE_KEY, v.Loadbalance) urlMap.Set("methods."+v.Name+"."+constant.RETRIES_KEY, v.Retries) urlMap.Set("methods."+v.Name+"."+constant.STICKY_KEY, strconv.FormatBool(v.Sticky)) + if len(v.RequestTimeout) != 0 { + urlMap.Set("methods."+v.Name+"."+constant.TIMEOUT_KEY, v.RequestTimeout) + } } return urlMap diff --git a/config/testdata/consumer_config.yml b/config/testdata/consumer_config.yml index f44ea449fd16235050f6a7ba7823a87e24791780..2034186c0fa0ccf21c3f6fb9df0f5cfd69315113 100644 --- a/config/testdata/consumer_config.yml +++ b/config/testdata/consumer_config.yml @@ -41,9 +41,11 @@ references: interface : "com.ikurento.user.UserProvider" url: "dubbo://127.0.0.1:20000/UserProvider" cluster: "failover" + timeout: "3s" methods : - name: "GetUser" retries: "3" + timeout: "5s" params: "serviceid": "soa.com.ikurento.user.UserProvider" @@ -54,12 +56,21 @@ shutdown_conf: step_timeout: 10s protocol_conf: + # when you choose the Dubbo protocol, the following configuration takes effect dubbo: reconnect_interval: 0 + # reconnect_interval is the actual number of connections a session can use connection_number: 2 - heartbeat_period: "5s" - session_timeout: "20s" - pool_size: 64 + # heartbeat_period is heartbeat interval between server and client connection. + # Effective by client configuration + heartbeat_period: "30s" + # when the session is inactive for more than session_timeout, the session may be closed + session_timeout: "30s" + # a reference has the size of the session connection pool + # that is the maximum number of sessions it may have + pool_size: 4 + # dubbo-go uses getty as the network connection library. + # The following is the relevant configuration of getty pool_ttl: 600 # gr_pool_size is recommended to be set to [cpu core number] * 100 gr_pool_size: 1200 @@ -67,6 +78,8 @@ protocol_conf: queue_len: 64 # queue_number is recommended to be set to gr_pool_size / 20 queue_number: 60 + # dubbo-go uses getty as the network connection library. + # The following is the relevant configuration of getty getty_session_param: compress_encoding: false tcp_no_delay: true @@ -78,5 +91,7 @@ protocol_conf: tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" - max_msg_len: 1024 + # maximum len of data per request + # this refers to the total amount of data requested or returned + max_msg_len: 102400 session_name: "client" diff --git a/config_center/apollo/impl_test.go b/config_center/apollo/impl_test.go index e898be91ee356180f5967f9dd5a02df0dbcfb311..2a891a212e3d37a0a2a3217b9883d173d6373859 100644 --- a/config_center/apollo/impl_test.go +++ b/config_center/apollo/impl_test.go @@ -21,9 +21,11 @@ import ( "fmt" "net/http" "net/http/httptest" + "os" "strings" "sync" "testing" + "time" ) import ( @@ -171,6 +173,7 @@ func Test_GetConfig(t *testing.T) { mapContent, err := configuration.Parser().Parse(configs) assert.NoError(t, err) assert.Equal(t, "ikurento.com", mapContent["application.organization"]) + deleteMockJson(t) } func Test_GetConfigItem(t *testing.T) { @@ -180,6 +183,7 @@ func Test_GetConfigItem(t *testing.T) { configuration.SetParser(&parser.DefaultConfigurationParser{}) assert.NoError(t, err) assert.Equal(t, "ikurento.com", configs) + deleteMockJson(t) } func initMockApollo(t *testing.T) *apolloConfiguration { @@ -216,6 +220,7 @@ func TestAddListener(t *testing.T) { listener.wg.Wait() assert.Equal(t, "registries.hangzhouzk.username", listener.event) assert.Greater(t, listener.count, 0) + deleteMockJson(t) } func TestRemoveListener(t *testing.T) { @@ -244,6 +249,7 @@ func TestRemoveListener(t *testing.T) { }) assert.Equal(t, listenerCount, 0) assert.Equal(t, listener.count, 0) + deleteMockJson(t) } type apolloDataListener struct { @@ -260,3 +266,10 @@ func (l *apolloDataListener) Process(configType *config_center.ConfigChangeEvent l.count++ l.event = configType.Key } + +func deleteMockJson(t *testing.T) { + //because the file write in another goroutine,so have a break ... + time.Sleep(100 * time.Millisecond) + remove := os.Remove("mockDubbog.properties.json") + t.Log("remove result:", remove) +} diff --git a/config_center/configurator/override.go b/config_center/configurator/override.go index e85b4d3ec9d5e6f9f7163cefce3f328f8dcc225a..8e8fe5cc1ab91eb779a73f85e3a71984f0ba6798 100644 --- a/config_center/configurator/override.go +++ b/config_center/configurator/override.go @@ -21,7 +21,7 @@ import ( ) import ( - "github.com/dubbogo/gost/container/gxset" + gxset "github.com/dubbogo/gost/container/set" gxnet "github.com/dubbogo/gost/net" ) diff --git a/filter/filter/access_log_filter.go b/filter/filter_impl/access_log_filter.go similarity index 99% rename from filter/filter/access_log_filter.go rename to filter/filter_impl/access_log_filter.go index cce2c5050fcbc60bc45b7bc2751685a8d9677b76..a1b022f27edef4a3bdb84c6117364394cd72aefe 100644 --- a/filter/filter/access_log_filter.go +++ b/filter/filter_impl/access_log_filter.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "os" diff --git a/filter/filter/access_log_filter_test.go b/filter/filter_impl/access_log_filter_test.go similarity index 99% rename from filter/filter/access_log_filter_test.go rename to filter/filter_impl/access_log_filter_test.go index 2c17021a9f17d3d99c48e5763087c0b03b490b93..5076962486da1ca40c4bdf6d7ba4b75a05bb0f92 100644 --- a/filter/filter/access_log_filter_test.go +++ b/filter/filter_impl/access_log_filter_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "context" diff --git a/filter/filter/active_filter.go b/filter/filter_impl/active_filter.go similarity index 98% rename from filter/filter/active_filter.go rename to filter/filter_impl/active_filter.go index e0f73c2b2facd53b23e491be2e5b123b5d33087d..b12f776322986b46e6ab0ca878e9d83bf74822e8 100644 --- a/filter/filter/active_filter.go +++ b/filter/filter_impl/active_filter.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "github.com/apache/dubbo-go/common/extension" diff --git a/filter/filter/echo_filter.go b/filter/filter_impl/echo_filter.go similarity index 98% rename from filter/filter/echo_filter.go rename to filter/filter_impl/echo_filter.go index 1515c0a99c77d7a4d9af93e141cbed9b529158d7..f67a47ac8704b1f6e10135bd24234cc0b8965dec 100644 --- a/filter/filter/echo_filter.go +++ b/filter/filter_impl/echo_filter.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "github.com/apache/dubbo-go/common/constant" diff --git a/filter/filter/echo_filter_test.go b/filter/filter_impl/echo_filter_test.go similarity index 98% rename from filter/filter/echo_filter_test.go rename to filter/filter_impl/echo_filter_test.go index d57d54329f52955d283366f6edc1376a1a474bde..b75b9c19a1f073cc23dfccfa97a51e456e59d9cc 100644 --- a/filter/filter/echo_filter_test.go +++ b/filter/filter_impl/echo_filter_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "testing" diff --git a/filter/filter/execute_limit_filter.go b/filter/filter_impl/execute_limit_filter.go similarity index 98% rename from filter/filter/execute_limit_filter.go rename to filter/filter_impl/execute_limit_filter.go index 4b5ea7491c19a726f1d90b7588ac5a480cd38590..a192aede400b1d73b7e604b09126ae372a1e91db 100644 --- a/filter/filter/execute_limit_filter.go +++ b/filter/filter_impl/execute_limit_filter.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "strconv" @@ -32,7 +32,7 @@ import ( "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/filter" - _ "github.com/apache/dubbo-go/filter/common" + _ "github.com/apache/dubbo-go/filter/handler" "github.com/apache/dubbo-go/protocol" ) diff --git a/filter/filter/execute_limit_filter_test.go b/filter/filter_impl/execute_limit_filter_test.go similarity index 99% rename from filter/filter/execute_limit_filter_test.go rename to filter/filter_impl/execute_limit_filter_test.go index 326b13677b157fbba2495caf5699c246d0d62879..e3836251df4ba78befcbb5720affb5dbc3cbdf1f 100644 --- a/filter/filter/execute_limit_filter_test.go +++ b/filter/filter_impl/execute_limit_filter_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "net/url" diff --git a/filter/filter/generic_filter.go b/filter/filter_impl/generic_filter.go similarity index 99% rename from filter/filter/generic_filter.go rename to filter/filter_impl/generic_filter.go index 9fb26f15aec7027d46526ed61a46d088a0b6b5e8..3bfae1e35d76cd65289d5f100da621a8fa745d1b 100644 --- a/filter/filter/generic_filter.go +++ b/filter/filter_impl/generic_filter.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "reflect" diff --git a/filter/filter/generic_filter_test.go b/filter/filter_impl/generic_filter_test.go similarity index 99% rename from filter/filter/generic_filter_test.go rename to filter/filter_impl/generic_filter_test.go index d5298adbd404d7a525bf66ef248cf54b525a6647..c4dc19270e8a81d65e8b56664d4ab0af204f29c5 100644 --- a/filter/filter/generic_filter_test.go +++ b/filter/filter_impl/generic_filter_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "reflect" diff --git a/filter/filter/generic_service_filter.go b/filter/filter_impl/generic_service_filter.go similarity index 99% rename from filter/filter/generic_service_filter.go rename to filter/filter_impl/generic_service_filter.go index 514a51f0b0f4c5d16109b97f74d1095e1842f658..da33f13e5ef29a7164c3776b65cc5cabd4b43888 100644 --- a/filter/filter/generic_service_filter.go +++ b/filter/filter_impl/generic_service_filter.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "reflect" diff --git a/filter/filter/generic_service_filter_test.go b/filter/filter_impl/generic_service_filter_test.go similarity index 99% rename from filter/filter/generic_service_filter_test.go rename to filter/filter_impl/generic_service_filter_test.go index 599a6a66d07ee0ed95545680ccb195f1a2fdeb68..e36ec5086ecacffbf56a0da6dd9249ffd6fec649 100644 --- a/filter/filter/generic_service_filter_test.go +++ b/filter/filter_impl/generic_service_filter_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "context" diff --git a/filter/filter/graceful_shutdown_filter.go b/filter/filter_impl/graceful_shutdown_filter.go similarity index 99% rename from filter/filter/graceful_shutdown_filter.go rename to filter/filter_impl/graceful_shutdown_filter.go index c682c7ef79deef2e66178cf1c43ec87992e960dc..1af7e1f8c32ea3924550399a7ff5e76c68368636 100644 --- a/filter/filter/graceful_shutdown_filter.go +++ b/filter/filter_impl/graceful_shutdown_filter.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "sync/atomic" diff --git a/filter/filter/graceful_shutdown_filter_test.go b/filter/filter_impl/graceful_shutdown_filter_test.go similarity index 97% rename from filter/filter/graceful_shutdown_filter_test.go rename to filter/filter_impl/graceful_shutdown_filter_test.go index af57cd4ec8db7a32abc9cdc09724035d8f67cd36..fc437c3557fa452273e770d3d50678401ba3b33b 100644 --- a/filter/filter/graceful_shutdown_filter_test.go +++ b/filter/filter_impl/graceful_shutdown_filter_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "net/url" @@ -32,7 +32,7 @@ import ( "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/config" "github.com/apache/dubbo-go/filter" - common2 "github.com/apache/dubbo-go/filter/common" + common2 "github.com/apache/dubbo-go/filter/handler" "github.com/apache/dubbo-go/protocol" "github.com/apache/dubbo-go/protocol/invocation" ) diff --git a/filter/filter/hystrix_filter.go b/filter/filter_impl/hystrix_filter.go similarity index 99% rename from filter/filter/hystrix_filter.go rename to filter/filter_impl/hystrix_filter.go index a7c57b4dd6c4a50f8ff90c6e22ff27cc5ef6658e..a6e07803046005b5ab31d7a02ea9e25f4b74da75 100644 --- a/filter/filter/hystrix_filter.go +++ b/filter/filter_impl/hystrix_filter.go @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package filter +package filter_impl import ( "fmt" diff --git a/filter/filter/hystrix_filter_test.go b/filter/filter_impl/hystrix_filter_test.go similarity index 99% rename from filter/filter/hystrix_filter_test.go rename to filter/filter_impl/hystrix_filter_test.go index 37432940300e558eee971448c5829b2d6c8f2696..2bbc3e079e7ae563db1efa18f82423931fd5919d 100644 --- a/filter/filter/hystrix_filter_test.go +++ b/filter/filter_impl/hystrix_filter_test.go @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package filter +package filter_impl import ( "regexp" diff --git a/filter/filter/token_filter.go b/filter/filter_impl/token_filter.go similarity index 98% rename from filter/filter/token_filter.go rename to filter/filter_impl/token_filter.go index 07b80f3402dbd63243b1c48e2d98c80a1f704362..180f3e6631a2fd0b317af3a4addd8d77287d82d5 100644 --- a/filter/filter/token_filter.go +++ b/filter/filter_impl/token_filter.go @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package filter +package filter_impl import ( "strings" diff --git a/filter/filter/token_filter_test.go b/filter/filter_impl/token_filter_test.go similarity index 99% rename from filter/filter/token_filter_test.go rename to filter/filter_impl/token_filter_test.go index 4434865de7918e41720fdd74eace32e9483901b6..675d33dc7d401b04f59037c1ec2eb44c8d6ecbe4 100644 --- a/filter/filter/token_filter_test.go +++ b/filter/filter_impl/token_filter_test.go @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package filter +package filter_impl import ( "net/url" diff --git a/filter/tps/tps_limit_fix_window_strategy.go b/filter/filter_impl/tps/tps_limit_fix_window_strategy.go similarity index 100% rename from filter/tps/tps_limit_fix_window_strategy.go rename to filter/filter_impl/tps/tps_limit_fix_window_strategy.go diff --git a/filter/tps/tps_limit_fix_window_strategy_test.go b/filter/filter_impl/tps/tps_limit_fix_window_strategy_test.go similarity index 100% rename from filter/tps/tps_limit_fix_window_strategy_test.go rename to filter/filter_impl/tps/tps_limit_fix_window_strategy_test.go diff --git a/filter/tps/tps_limit_sliding_window_strategy.go b/filter/filter_impl/tps/tps_limit_sliding_window_strategy.go similarity index 100% rename from filter/tps/tps_limit_sliding_window_strategy.go rename to filter/filter_impl/tps/tps_limit_sliding_window_strategy.go diff --git a/filter/tps/tps_limit_sliding_window_strategy_test.go b/filter/filter_impl/tps/tps_limit_sliding_window_strategy_test.go similarity index 100% rename from filter/tps/tps_limit_sliding_window_strategy_test.go rename to filter/filter_impl/tps/tps_limit_sliding_window_strategy_test.go diff --git a/filter/tps/tps_limit_strategy_mock.go b/filter/filter_impl/tps/tps_limit_strategy_mock.go similarity index 100% rename from filter/tps/tps_limit_strategy_mock.go rename to filter/filter_impl/tps/tps_limit_strategy_mock.go diff --git a/filter/tps/tps_limit_thread_safe_fix_window_strategy.go b/filter/filter_impl/tps/tps_limit_thread_safe_fix_window_strategy.go similarity index 100% rename from filter/tps/tps_limit_thread_safe_fix_window_strategy.go rename to filter/filter_impl/tps/tps_limit_thread_safe_fix_window_strategy.go diff --git a/filter/tps/tps_limit_thread_safe_fix_window_strategy_test.go b/filter/filter_impl/tps/tps_limit_thread_safe_fix_window_strategy_test.go similarity index 100% rename from filter/tps/tps_limit_thread_safe_fix_window_strategy_test.go rename to filter/filter_impl/tps/tps_limit_thread_safe_fix_window_strategy_test.go diff --git a/filter/tps/tps_limiter_method_service.go b/filter/filter_impl/tps/tps_limiter_method_service.go similarity index 100% rename from filter/tps/tps_limiter_method_service.go rename to filter/filter_impl/tps/tps_limiter_method_service.go diff --git a/filter/tps/tps_limiter_method_service_test.go b/filter/filter_impl/tps/tps_limiter_method_service_test.go similarity index 100% rename from filter/tps/tps_limiter_method_service_test.go rename to filter/filter_impl/tps/tps_limiter_method_service_test.go diff --git a/filter/tps/tps_limiter_mock.go b/filter/filter_impl/tps/tps_limiter_mock.go similarity index 100% rename from filter/tps/tps_limiter_mock.go rename to filter/filter_impl/tps/tps_limiter_mock.go diff --git a/filter/filter/tps_limit_filter.go b/filter/filter_impl/tps_limit_filter.go similarity index 95% rename from filter/filter/tps_limit_filter.go rename to filter/filter_impl/tps_limit_filter.go index ccccec00d4741481534185eaab290fc717864bd8..77414a8ea70743983cadc609c875920cff525487 100644 --- a/filter/filter/tps_limit_filter.go +++ b/filter/filter_impl/tps_limit_filter.go @@ -15,15 +15,15 @@ * limitations under the License. */ -package filter +package filter_impl import ( "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/filter" - _ "github.com/apache/dubbo-go/filter/common" - _ "github.com/apache/dubbo-go/filter/tps" + _ "github.com/apache/dubbo-go/filter/filter_impl/tps" + _ "github.com/apache/dubbo-go/filter/handler" "github.com/apache/dubbo-go/protocol" ) diff --git a/filter/filter/tps_limit_filter_test.go b/filter/filter_impl/tps_limit_filter_test.go similarity index 96% rename from filter/filter/tps_limit_filter_test.go rename to filter/filter_impl/tps_limit_filter_test.go index 6acaab7036307299da18aefbccf011923df8e287..5e04804aa23c4e6e417f6bb9975a3269a2118739 100644 --- a/filter/filter/tps_limit_filter_test.go +++ b/filter/filter_impl/tps_limit_filter_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package filter +package filter_impl import ( "net/url" @@ -24,8 +24,8 @@ import ( import ( "github.com/apache/dubbo-go/filter" - common2 "github.com/apache/dubbo-go/filter/common" - "github.com/apache/dubbo-go/filter/tps" + "github.com/apache/dubbo-go/filter/filter_impl/tps" + common2 "github.com/apache/dubbo-go/filter/handler" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/filter/common/rejected_execution_handler_mock.go b/filter/handler/rejected_execution_handler_mock.go similarity index 99% rename from filter/common/rejected_execution_handler_mock.go rename to filter/handler/rejected_execution_handler_mock.go index a5631af9f7600cae772437877b1ac9139655cc5f..a5bef63b3729a7b04d911c9844320aa778ac357a 100644 --- a/filter/common/rejected_execution_handler_mock.go +++ b/filter/handler/rejected_execution_handler_mock.go @@ -18,7 +18,7 @@ // Source: rejected_execution_handler.go // Package filter is a generated GoMock package. -package common +package handler import ( reflect "reflect" diff --git a/filter/common/rejected_execution_handler_only_log.go b/filter/handler/rejected_execution_handler_only_log.go similarity index 99% rename from filter/common/rejected_execution_handler_only_log.go rename to filter/handler/rejected_execution_handler_only_log.go index 65abe677f129fa2fbe412c7e3ea2b23de2f1ade6..83d85fd1e1a80462e454ef5a8bcd375f5a2b0bcb 100644 --- a/filter/common/rejected_execution_handler_only_log.go +++ b/filter/handler/rejected_execution_handler_only_log.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package common +package handler import ( "github.com/apache/dubbo-go/filter" diff --git a/filter/common/rejected_execution_handler_only_log_test.go b/filter/handler/rejected_execution_handler_only_log_test.go similarity index 98% rename from filter/common/rejected_execution_handler_only_log_test.go rename to filter/handler/rejected_execution_handler_only_log_test.go index 0efc3d813771577d38fd5e7989255fc097b49a08..409f09f61bd958992749231fca045b54601fc627 100644 --- a/filter/common/rejected_execution_handler_only_log_test.go +++ b/filter/handler/rejected_execution_handler_only_log_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package common +package handler import ( "net/url" diff --git a/go.mod b/go.mod index 699b8bd98244a4d6491b4d076ac061e7d51d8ab7..d8142c0bb698b1356dad22d4527bf305c8c12915 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ require ( github.com/Workiva/go-datastructures v1.0.50 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190802083043-4cd0c391755e // indirect - github.com/apache/dubbo-go-hessian2 v1.2.5-0.20191029001541-894e45c9aaaa + github.com/apache/dubbo-go-hessian2 v1.3.1-0.20200106042936-0e1fc43955b2 github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23 // indirect github.com/coreos/bbolt v1.3.3 // indirect github.com/coreos/etcd v3.3.13+incompatible @@ -13,7 +13,7 @@ require ( github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/creasty/defaults v1.3.0 github.com/dubbogo/getty v1.3.1 - github.com/dubbogo/gost v1.3.0 + github.com/dubbogo/gost v1.5.1 github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect github.com/go-errors/errors v1.0.1 // indirect github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect diff --git a/go.sum b/go.sum index 804fdd40987c13fbd00973dfec3e7e425a2a3870..90f64a1f71feb5f4b22be52df90fc4321db41b4a 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190802083043-4cd0c391755e h1:MSuLXx/mveDbpDNhVrcWTMeV4lbYWKcyO4rH+jAxmX0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190802083043-4cd0c391755e/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/apache/dubbo-go-hessian2 v1.2.5-0.20191029001541-894e45c9aaaa h1:11TO1wiM5bvGAVrmfN5atD8gZqUSPE1TBoIs8sI6Abk= -github.com/apache/dubbo-go-hessian2 v1.2.5-0.20191029001541-894e45c9aaaa/go.mod h1:LWnndnrFXZmJLAzoyNAPNHSIJ1KOHVkTSsHgC3YYWlo= +github.com/apache/dubbo-go-hessian2 v1.3.1-0.20200106042936-0e1fc43955b2 h1:SFqItOYknm1g4iKgjp2GT7aKBtsgejD3hdVq0UnLUv0= +github.com/apache/dubbo-go-hessian2 v1.3.1-0.20200106042936-0e1fc43955b2/go.mod h1:VwEnsOMidkM1usya2uPfGpSLO9XUF//WQcWn3y+jFz8= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -104,10 +104,9 @@ github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dubbogo/getty v1.3.1 h1:9fehwTo/D6+z6/+kADMbhbKeMkP80o/3g+XwV5lFLTY= github.com/dubbogo/getty v1.3.1/go.mod h1:dtLOEb1v6EMHsQNYRWEACiRLmTWB2kJGUAj1aXayPOg= -github.com/dubbogo/gost v1.1.1 h1:JCM7vx5edPIjDA5ovJTuzEEXuw2t7xLyrlgi2mi5jHI= github.com/dubbogo/gost v1.1.1/go.mod h1:R7wZm1DrmrKGr50mBZVcg6C9ekG8aL5hP+sgWcIDwQg= -github.com/dubbogo/gost v1.3.0 h1:n90mIUWCPD69BqW8wJ43NDy0RgNxx02aAG4QJcJ785U= -github.com/dubbogo/gost v1.3.0/go.mod h1:R7wZm1DrmrKGr50mBZVcg6C9ekG8aL5hP+sgWcIDwQg= +github.com/dubbogo/gost v1.5.1 h1:oG5dzaWf1KYynBaBoUIOkgT+YD0niHV6xxI0Odq7hDg= +github.com/dubbogo/gost v1.5.1/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= github.com/duosecurity/duo_api_golang v0.0.0-20190308151101-6c680f768e74 h1:2MIhn2R6oXQbgW5yHfS+d6YqyMfXiu2L55rFZC4UD/M= github.com/duosecurity/duo_api_golang v0.0.0-20190308151101-6c680f768e74/go.mod h1:UqXY1lYT/ERa4OEAywUqdok1T4RCRdArkhic1Opuavo= github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0 h1:ZoRgc53qJCfSLimXqJDrmBhnt5GChDsExMCK7t48o0Y= diff --git a/protocol/dubbo/client.go b/protocol/dubbo/client.go index 81f392565f701d990dc1783d5d467814a0fba5bf..3e2a243103b888d8b94c2e50fe00daabb3d5a032 100644 --- a/protocol/dubbo/client.go +++ b/protocol/dubbo/client.go @@ -212,7 +212,15 @@ func (c *Client) call(ct CallType, request *Request, response *Response, callbac p.Service.Version = request.svcUrl.GetParam(constant.VERSION_KEY, "") p.Service.Group = request.svcUrl.GetParam(constant.GROUP_KEY, "") p.Service.Method = request.method + p.Service.Timeout = c.opts.RequestTimeout + var timeout = request.svcUrl.GetParam(strings.Join([]string{constant.METHOD_KEYS, request.method + constant.RETRIES_KEY}, "."), "") + if len(timeout) != 0 { + if t, err := time.ParseDuration(timeout); err == nil { + p.Service.Timeout = t + } + } + p.Header.SerialID = byte(S_Dubbo) p.Body = hessian.NewRequest(request.args, request.atta) diff --git a/protocol/dubbo/dubbo_protocol.go b/protocol/dubbo/dubbo_protocol.go index 2e4f73878c406e699179dcc6225e6d23aebdcf48..cf395556a6aba27b892f1e2541a27dae2c01aebf 100644 --- a/protocol/dubbo/dubbo_protocol.go +++ b/protocol/dubbo/dubbo_protocol.go @@ -19,10 +19,12 @@ package dubbo import ( "sync" + "time" ) import ( "github.com/apache/dubbo-go/common" + "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/config" @@ -67,9 +69,17 @@ func (dp *DubboProtocol) Export(invoker protocol.Invoker) protocol.Exporter { } func (dp *DubboProtocol) Refer(url common.URL, impl interface{}) protocol.Invoker { + //default requestTimeout + var requestTimeout = config.GetConsumerConfig().RequestTimeout + + requestTimeoutStr := url.GetParam(constant.TIMEOUT_KEY, config.GetConsumerConfig().Request_Timeout) + if t, err := time.ParseDuration(requestTimeoutStr); err == nil { + requestTimeout = t + } + invoker := NewDubboInvoker(url, NewClient(Options{ ConnectTimeout: config.GetConsumerConfig().ConnectTimeout, - RequestTimeout: config.GetConsumerConfig().RequestTimeout, + RequestTimeout: requestTimeout, })) dp.SetInvokers(invoker) logger.Infof("Refer service: %s", url.String()) diff --git a/protocol/jsonrpc/jsonrpc_protocol.go b/protocol/jsonrpc/jsonrpc_protocol.go index a512da77ad4635be57b90228f26407dc674a28eb..679478766123cd14c45c3a27c6604e1ef4bc69c2 100644 --- a/protocol/jsonrpc/jsonrpc_protocol.go +++ b/protocol/jsonrpc/jsonrpc_protocol.go @@ -20,10 +20,12 @@ package jsonrpc import ( "strings" "sync" + "time" ) import ( "github.com/apache/dubbo-go/common" + "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/config" @@ -66,9 +68,17 @@ func (jp *JsonrpcProtocol) Export(invoker protocol.Invoker) protocol.Exporter { } func (jp *JsonrpcProtocol) Refer(url common.URL, impl interface{}) protocol.Invoker { + //default requestTimeout + var requestTimeout = config.GetConsumerConfig().RequestTimeout + + requestTimeoutStr := url.GetParam(constant.TIMEOUT_KEY, config.GetConsumerConfig().Request_Timeout) + if t, err := time.ParseDuration(requestTimeoutStr); err == nil { + requestTimeout = t + } + invoker := NewJsonrpcInvoker(url, NewHTTPClient(&HTTPOptions{ HandshakeTimeout: config.GetConsumerConfig().ConnectTimeout, - HTTPTimeout: config.GetConsumerConfig().RequestTimeout, + HTTPTimeout: requestTimeout, })) jp.SetInvokers(invoker) logger.Infof("Refer service: %s", url.String()) diff --git a/registry/etcdv3/registry_test.go b/registry/etcdv3/registry_test.go index 3f8c0f4cfccc2bcc68fc1e55fa69d74e9f0f8c0f..6c05a8a83fce50053272181902aeaecdaee9597c 100644 --- a/registry/etcdv3/registry_test.go +++ b/registry/etcdv3/registry_test.go @@ -62,7 +62,7 @@ func (suite *RegistryTestSuite) TestRegister() { if err != nil { t.Fatal(err) } - assert.Regexp(t, ".*dubbo%3A%2F%2F127.0.0.1%3A20000%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26category%3Dproviders%26cluster%3Dmock%26dubbo%3Ddubbo-provider-golang-2.6.0%26.*provider", children) + assert.Regexp(t, ".*dubbo%3A%2F%2F127.0.0.1%3A20000%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26category%3Dproviders%26cluster%3Dmock%26dubbo%3Ddubbo-provider-golang-1.3.0%26.*provider", children) assert.NoError(t, err) } diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go index 6bb5305d6c265abef8f000fafe39880220161837..1bcc4d72ca98b31a0288323e4cff7aecf243868d 100644 --- a/registry/protocol/protocol.go +++ b/registry/protocol/protocol.go @@ -23,7 +23,7 @@ import ( ) import ( - "github.com/dubbogo/gost/container/gxset" + gxset "github.com/dubbogo/gost/container/set" ) import ( diff --git a/registry/zookeeper/listener_test.go b/registry/zookeeper/listener_test.go index 910d47b7e4e3d27c6f7245777cba1f46adc8e318..615a4bb16a7c5cc3f3e968db24e6bd05ecfdae2a 100644 --- a/registry/zookeeper/listener_test.go +++ b/registry/zookeeper/listener_test.go @@ -34,9 +34,9 @@ import ( func Test_DataChange(t *testing.T) { listener := NewRegistryDataListener(&MockDataListener{}) - url, _ := common.NewURL(context.TODO(), "jsonrpc%3A%2F%2F127.0.0.1%3A20001%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26app.version%3D0.0.1%26application%3DBDTService%26category%3Dproviders%26cluster%3Dfailover%26dubbo%3Ddubbo-provider-golang-2.6.0%26environment%3Ddev%26group%3D%26interface%3Dcom.ikurento.user.UserProvider%26ip%3D10.32.20.124%26loadbalance%3Drandom%26methods.GetUser.loadbalance%3Drandom%26methods.GetUser.retries%3D1%26methods.GetUser.weight%3D0%26module%3Ddubbogo%2Buser-info%2Bserver%26name%3DBDTService%26organization%3Dikurento.com%26owner%3DZX%26pid%3D74500%26retries%3D0%26service.filter%3Decho%26side%3Dprovider%26timestamp%3D1560155407%26version%3D%26warmup%3D100") + url, _ := common.NewURL(context.TODO(), "jsonrpc%3A%2F%2F127.0.0.1%3A20001%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26app.version%3D0.0.1%26application%3DBDTService%26category%3Dproviders%26cluster%3Dfailover%26dubbo%3Ddubbo-provider-golang-1.3.0%26environment%3Ddev%26group%3D%26interface%3Dcom.ikurento.user.UserProvider%26ip%3D10.32.20.124%26loadbalance%3Drandom%26methods.GetUser.loadbalance%3Drandom%26methods.GetUser.retries%3D1%26methods.GetUser.weight%3D0%26module%3Ddubbogo%2Buser-info%2Bserver%26name%3DBDTService%26organization%3Dikurento.com%26owner%3DZX%26pid%3D74500%26retries%3D0%26service.filter%3Decho%26side%3Dprovider%26timestamp%3D1560155407%26version%3D%26warmup%3D100") listener.AddInterestedURL(&url) - int := listener.DataChange(remoting.Event{Path: "/dubbo/com.ikurento.user.UserProvider/providers/jsonrpc%3A%2F%2F127.0.0.1%3A20001%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26app.version%3D0.0.1%26application%3DBDTService%26category%3Dproviders%26cluster%3Dfailover%26dubbo%3Ddubbo-provider-golang-2.6.0%26environment%3Ddev%26group%3D%26interface%3Dcom.ikurento.user.UserProvider%26ip%3D10.32.20.124%26loadbalance%3Drandom%26methods.GetUser.loadbalance%3Drandom%26methods.GetUser.retries%3D1%26methods.GetUser.weight%3D0%26module%3Ddubbogo%2Buser-info%2Bserver%26name%3DBDTService%26organization%3Dikurento.com%26owner%3DZX%26pid%3D74500%26retries%3D0%26service.filter%3Decho%26side%3Dprovider%26timestamp%3D1560155407%26version%3D%26warmup%3D100"}) + int := listener.DataChange(remoting.Event{Path: "/dubbo/com.ikurento.user.UserProvider/providers/jsonrpc%3A%2F%2F127.0.0.1%3A20001%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26app.version%3D0.0.1%26application%3DBDTService%26category%3Dproviders%26cluster%3Dfailover%26dubbo%3Ddubbo-provider-golang-1.3.0%26environment%3Ddev%26group%3D%26interface%3Dcom.ikurento.user.UserProvider%26ip%3D10.32.20.124%26loadbalance%3Drandom%26methods.GetUser.loadbalance%3Drandom%26methods.GetUser.retries%3D1%26methods.GetUser.weight%3D0%26module%3Ddubbogo%2Buser-info%2Bserver%26name%3DBDTService%26organization%3Dikurento.com%26owner%3DZX%26pid%3D74500%26retries%3D0%26service.filter%3Decho%26side%3Dprovider%26timestamp%3D1560155407%26version%3D%26warmup%3D100"}) assert.Equal(t, true, int) } diff --git a/registry/zookeeper/registry_test.go b/registry/zookeeper/registry_test.go index 841c38da7fbf1830b6f7c55809fc50d52468ef46..2c7bb9061f8accc775fa840508f4363753acbc1a 100644 --- a/registry/zookeeper/registry_test.go +++ b/registry/zookeeper/registry_test.go @@ -42,7 +42,7 @@ func Test_Register(t *testing.T) { defer ts.Stop() err := reg.Register(url) children, _ := reg.client.GetChildren("/dubbo/com.ikurento.user.UserProvider/providers") - assert.Regexp(t, ".*dubbo%3A%2F%2F127.0.0.1%3A20000%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26category%3Dproviders%26cluster%3Dmock%26dubbo%3Ddubbo-provider-golang-2.6.0%26.*.serviceid%3Dsoa.mock%26.*provider", children) + assert.Regexp(t, ".*dubbo%3A%2F%2F127.0.0.1%3A20000%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26category%3Dproviders%26cluster%3Dmock%26dubbo%3Ddubbo-provider-golang-1.3.0%26.*.serviceid%3Dsoa.mock%26.*provider", children) assert.NoError(t, err) }