Skip to content
Snippets Groups Projects
Commit 31c898f5 authored by pantianying's avatar pantianying
Browse files

add Generic tag

parent 428fad4f
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@ type ReferenceConfig struct {
Params map[string]string `yaml:"params" json:"params,omitempty" property:"params"`
invoker protocol.Invoker
urls []*common.URL
Generic bool
}
func (c *ReferenceConfig) Prefix() string {
......@@ -170,7 +171,10 @@ func (refconfig *ReferenceConfig) getUrlMap() url.Values {
//filter
urlMap.Set(constant.REFERENCE_FILTER_KEY, mergeValue(consumerConfig.Filter, refconfig.Filter, constant.DEFAULT_REFERENCE_FILTERS))
urlMap.Set(constant.REFERENCE_FILTER_KEY, mergeValue(consumerConfig.Filter, refconfig.Filter, constant.GENERIC_REFERENCE_FILTERS))
if refconfig.Generic {
urlMap.Set(constant.REFERENCE_FILTER_KEY, mergeValue(consumerConfig.Filter, refconfig.Filter, constant.GENERIC_REFERENCE_FILTERS))
}
for _, v := range refconfig.Methods {
urlMap.Set("methods."+v.Name+"."+constant.LOADBALANCE_KEY, v.Loadbalance)
urlMap.Set("methods."+v.Name+"."+constant.RETRIES_KEY, strconv.FormatInt(v.Retries, 10))
......
......@@ -295,6 +295,7 @@ func test3() {
Cluster: "failover",
Registry: "hangzhouzk",
Protocol: dubbo.DUBBO,
Generic: true,
}
referenceConfig.Load(appName) //appName is the unique identification of RPCService
......
......@@ -19,9 +19,9 @@ package impl
import (
"github.com/stretchr/testify/assert"
"reflect"
)
import (
"reflect"
"testing"
)
......
......@@ -116,7 +116,7 @@ func (dir *registryDirectory) Subscribe(url common.URL) {
}
//subscribe service from registry , and update the cacheServices
func (dir *registryDirectory) update(res *registry.ServiceEvent) {
func (dir *registryDirectory) /**/ update(res *registry.ServiceEvent) {
if res == nil {
return
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment