From 05b68925f8cc6117ddb53d5a7642b8d4735485df Mon Sep 17 00:00:00 2001 From: fangyincheng <fangyincheng@sina.com> Date: Tue, 18 Jun 2019 16:04:37 +0800 Subject: [PATCH] Fix:fix bug --- examples/dubbo/go-server/app/user.go | 15 --------------- .../resources/META-INF/spring/dubbo.consumer.xml | 2 +- protocol/dubbo/listener.go | 8 ++++++-- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/examples/dubbo/go-server/app/user.go b/examples/dubbo/go-server/app/user.go index 8203d9589..fcd9ea7b8 100644 --- a/examples/dubbo/go-server/app/user.go +++ b/examples/dubbo/go-server/app/user.go @@ -37,7 +37,6 @@ type Gender hessian.JavaEnum func init() { config.SetProviderService(new(UserProvider)) - config.SetProviderService(new(UsersProvider)) } const ( @@ -209,20 +208,6 @@ func (u *UserProvider) Version() string { return "" } -type UsersProvider struct { -} - -func (s *UsersProvider) GetXxx() error { - return nil -} -func (u *UsersProvider) Service() string { - return "com.ikurento.user.UsersProvider" -} - -func (u *UsersProvider) Version() string { - return "" -} - func println(format string, args ...interface{}) { fmt.Printf("\033[32;40m"+format+"\033[0m\n", args...) } diff --git a/examples/dubbo/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml b/examples/dubbo/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml index 07a9084c0..727007257 100644 --- a/examples/dubbo/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml +++ b/examples/dubbo/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml @@ -34,7 +34,7 @@ <!-- 澹版槑闇€瑕佷娇鐢ㄧ殑鏈嶅姟鎺ュ彛 --> <!--<dubbo:reference id="userProvider" protocol="jsonrpc" interface="com.ikurento.user.UserProvider">--> - <dubbo:reference registry="ikurento" check="false" id="userProvider" protocol="dubbo" interface="com.ikurento.user.UserProvider" version="2.0" group="as"> + <dubbo:reference registry="ikurento" check="false" id="userProvider" protocol="dubbo" interface="com.ikurento.user.UserProvider"> <!--<dubbo:parameter key="heartbeat" value="10000"/ --> </dubbo:reference> diff --git a/protocol/dubbo/listener.go b/protocol/dubbo/listener.go index b77918383..15e222676 100644 --- a/protocol/dubbo/listener.go +++ b/protocol/dubbo/listener.go @@ -208,8 +208,12 @@ func (h *RpcServerHandler) OnMessage(session getty.Session, pkg interface{}) { twoway = false } + group := p.Body.(map[string]interface{})["attachments"].(map[interface{}]interface{})[constant.GROUP_KEY] + if group == nil { + group = "" + } u := common.NewURLWithOptions(common.WithPath(p.Service.Path), common.WithParams(url.Values{}), - common.WithParamsValue(constant.GROUP_KEY, ""), + common.WithParamsValue(constant.GROUP_KEY, group.(string)), common.WithParamsValue(constant.INTERFACE_KEY, p.Service.Interface), common.WithParamsValue(constant.VERSION_KEY, p.Service.Version)) exporter, _ := dubboProtocol.ExporterMap().Load(u.ServiceKey()) @@ -225,7 +229,7 @@ func (h *RpcServerHandler) OnMessage(session getty.Session, pkg interface{}) { if invoker != nil { result := invoker.Invoke(invocation.NewRPCInvocationForProvider(p.Service.Method, p.Body.(map[string]interface{})["args"].([]interface{}), map[string]string{ constant.PATH_KEY: p.Service.Path, - constant.GROUP_KEY: "", + constant.GROUP_KEY: group.(string), constant.INTERFACE_KEY: p.Service.Interface, constant.VERSION_KEY: p.Service.Version, })) -- GitLab