From 31c898f5950f39ae7f677cd82867fb541c38140b Mon Sep 17 00:00:00 2001
From: pantianying <601666418@qq.com>
Date: Wed, 31 Jul 2019 10:41:01 +0800
Subject: [PATCH] add Generic tag

---
 config/reference_config.go                     | 6 +++++-
 examples/general/dubbo/go-client/app/client.go | 1 +
 filter/impl/generic_filter_test.go             | 2 +-
 registry/directory/directory.go                | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/config/reference_config.go b/config/reference_config.go
index c1565004c..99d442ad4 100644
--- a/config/reference_config.go
+++ b/config/reference_config.go
@@ -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))
diff --git a/examples/general/dubbo/go-client/app/client.go b/examples/general/dubbo/go-client/app/client.go
index b79874b2b..62113e2d3 100644
--- a/examples/general/dubbo/go-client/app/client.go
+++ b/examples/general/dubbo/go-client/app/client.go
@@ -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
 
diff --git a/filter/impl/generic_filter_test.go b/filter/impl/generic_filter_test.go
index b039fbd89..bdeb95329 100644
--- a/filter/impl/generic_filter_test.go
+++ b/filter/impl/generic_filter_test.go
@@ -19,9 +19,9 @@ package impl
 
 import (
 	"github.com/stretchr/testify/assert"
-	"reflect"
 )
 import (
+	"reflect"
 	"testing"
 )
 
diff --git a/registry/directory/directory.go b/registry/directory/directory.go
index 11687f82e..6a5a19439 100644
--- a/registry/directory/directory.go
+++ b/registry/directory/directory.go
@@ -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
 	}
-- 
GitLab