diff --git a/examples/dubbo/go-server/app/user.go b/examples/dubbo/go-server/app/user.go index fcd9ea7b86..3c261dc029 100644 --- a/examples/dubbo/go-server/app/user.go +++ b/examples/dubbo/go-server/app/user.go @@ -26,6 +26,7 @@ import ( import ( "github.com/dubbogo/hessian2" + "github.com/dubbogo/hessian2/java_exception" perrors "github.com/pkg/errors" ) @@ -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 e4400cc270..b84e7229cc 100644 --- a/examples/dubbo/with-configcenter-go-server/app/user.go +++ b/examples/dubbo/with-configcenter-go-server/app/user.go @@ -31,6 +31,7 @@ import ( import ( "github.com/apache/dubbo-go/config" hessian "github.com/dubbogo/hessian2" + "github.com/dubbogo/hessian2/java_exception" ) type Gender hessian.JavaEnum @@ -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 ef4c7b2ca8..8fd3c215fb 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.0.2 + 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 3af6b3eb0d..859e9aab1c 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.0.2 h1:Ka9Z32ZszGAdCpgrGuZQmwkT0qe1pd3o9r7ERCDnSlQ= -github.com/dubbogo/hessian2 v1.0.2/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 56f95090c2..8ba46e7b0b 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 f585666b37..4f5229d672 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]) }