diff --git a/examples/dubbo/go-server/app/user.go b/examples/dubbo/go-server/app/user.go index fcd9ea7b8677add705127b817799bcb4beb6dabb..e2f5aec99dd061807e13297f547f5bcb30c9a23d 100644 --- a/examples/dubbo/go-server/app/user.go +++ b/examples/dubbo/go-server/app/user.go @@ -20,6 +20,7 @@ package main import ( "context" "fmt" + "github.com/dubbogo/hessian2/java_exception" "strconv" "time" ) @@ -172,7 +173,7 @@ func (u *UserProvider) GetUser3() error { } func (u *UserProvider) GetErr(ctx context.Context, req []interface{}, rsp *User) error { - return hessian.NewThrowable("exception") + return java_exception.NewThrowable("exception") } func (u *UserProvider) GetUsers(req []interface{}) ([]interface{}, error) { diff --git a/examples/dubbo/with-configcenter-go-server/app/user.go b/examples/dubbo/with-configcenter-go-server/app/user.go index e4400cc270ad46c84085b52e8879bbd49969bcb0..54c58ada47520a7ac8174240ac18aba7e354c63c 100644 --- a/examples/dubbo/with-configcenter-go-server/app/user.go +++ b/examples/dubbo/with-configcenter-go-server/app/user.go @@ -20,6 +20,7 @@ package main import ( "context" "fmt" + "github.com/dubbogo/hessian2/java_exception" "strconv" "time" ) @@ -146,7 +147,7 @@ func (u *UserProvider) GetUser(ctx context.Context, req []interface{}, rsp *User } func (u *UserProvider) GetErr(ctx context.Context, req []interface{}, rsp *User) error { - return hessian.NewThrowable("exception") + return java_exception.NewThrowable("exception") } func (u *UserProvider) GetUser0(id string, name string) (User, error) { diff --git a/go.mod b/go.mod index 3c61a83f1988b13762f38a90fb0abbceec8cbf0c..8fd3c215fbb38b9c54a6570630f5ef32ad8f56c1 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/apache/dubbo-go require ( github.com/dubbogo/getty v1.0.7 github.com/dubbogo/gost v1.0.0 - github.com/dubbogo/hessian2 v1.1.1 + github.com/dubbogo/hessian2 v1.1.2 github.com/magiconair/properties v1.8.1 github.com/pkg/errors v0.8.1 github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec diff --git a/go.sum b/go.sum index 09b3e7fd08c0e6d98c222f582c0a4673bbb92da5..859e9aab1c882f3864668b45c6ac47ce7f01b262 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/dubbogo/getty v1.0.7 h1:5Hg+JwXyCKm9Yr4yJkm98ahhnoa8c2h6br5QJxwQ+YU= github.com/dubbogo/getty v1.0.7/go.mod h1:cRMSuoCmwc5lULFFnYZTxyCfZhObmRTNbS7XRnPNHSo= github.com/dubbogo/gost v1.0.0 h1:obKvpJYdrIY2BidHYwYoj2E50OtwCDqVVVTcH2nnhAY= github.com/dubbogo/gost v1.0.0/go.mod h1:R7wZm1DrmrKGr50mBZVcg6C9ekG8aL5hP+sgWcIDwQg= -github.com/dubbogo/hessian2 v1.1.1 h1:X8UlNUvn/lqct2GKY37MFGnZ2f51HRndAQHk6+RMtqc= -github.com/dubbogo/hessian2 v1.1.1/go.mod h1:XFGDn4oSZX26zkcfhkM/fCJrOqwQJxk/xgWW1KMJBKM= +github.com/dubbogo/hessian2 v1.1.2 h1:SRkPzIwVv2D+ZUOCE2XuI5kANoL01ShhAheLcc3usJE= +github.com/dubbogo/hessian2 v1.1.2/go.mod h1:XFGDn4oSZX26zkcfhkM/fCJrOqwQJxk/xgWW1KMJBKM= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= diff --git a/protocol/dubbo/client.go b/protocol/dubbo/client.go index 56f95090c2658bc2760ca72e4fd662f2b99d95e0..8ba46e7b0b321095652fb7c6d0c1c7403e1fea1e 100644 --- a/protocol/dubbo/client.go +++ b/protocol/dubbo/client.go @@ -217,7 +217,6 @@ func (c *Client) call(ct CallType, addr string, svcUrl common.URL, method string p := &DubboPackage{} p.Service.Path = strings.TrimPrefix(svcUrl.Path, "/") - p.Service.Target = svcUrl.GetParam(constant.INTERFACE_KEY, "") p.Service.Interface = svcUrl.GetParam(constant.INTERFACE_KEY, "") p.Service.Version = svcUrl.GetParam(constant.VERSION_KEY, "") p.Service.Method = method diff --git a/protocol/dubbo/codec_test.go b/protocol/dubbo/codec_test.go index f585666b3769d1384681039d25cea98a36a589fc..4f5229d67242e582a128caa40c205482e813f08e 100644 --- a/protocol/dubbo/codec_test.go +++ b/protocol/dubbo/codec_test.go @@ -49,7 +49,6 @@ func TestDubboPackage_MarshalAndUnmarshal(t *testing.T) { // request pkg.Header.Type = hessian.PackageRequest pkg.Service.Interface = "Service" - pkg.Service.Target = "Service" pkg.Service.Version = "2.6" pkg.Service.Method = "Method" pkg.Service.Timeout = time.Second @@ -64,10 +63,10 @@ func TestDubboPackage_MarshalAndUnmarshal(t *testing.T) { assert.Equal(t, byte(S_Dubbo), pkgres.Header.SerialID) assert.Equal(t, int64(10086), pkgres.Header.ID) assert.Equal(t, "2.5.4", pkgres.Body.([]interface{})[0]) - assert.Equal(t, "Service", pkgres.Body.([]interface{})[1]) + assert.Equal(t, "", pkgres.Body.([]interface{})[1]) assert.Equal(t, "2.6", pkgres.Body.([]interface{})[2]) assert.Equal(t, "Method", pkgres.Body.([]interface{})[3]) assert.Equal(t, "Ljava/lang/String;", pkgres.Body.([]interface{})[4]) assert.Equal(t, []interface{}{"a"}, pkgres.Body.([]interface{})[5]) - assert.Equal(t, map[interface{}]interface{}{"interface": "Service", "path": "", "timeout": "1000"}, pkgres.Body.([]interface{})[6]) + assert.Equal(t, map[interface{}]interface{}{"interface": "Service", "path": "", "group": "", "timeout": "1000"}, pkgres.Body.([]interface{})[6]) }