diff --git a/examples/dubbo/go-server/app/user.go b/examples/dubbo/go-server/app/user.go index fcd9ea7b8677add705127b817799bcb4beb6dabb..3c261dc029022fe8a3a80a4007e5aa132643eb7c 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 e4400cc270ad46c84085b52e8879bbd49969bcb0..b84e7229cc62ce5b3c8e8b0a3927c55b2aff9df8 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 ef4c7b2ca8e17c4013f0916964597b43c9ae4615..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.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 3af6b3eb0d163f358e622769edbe6b856823afac..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.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 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]) } diff --git a/remoting/zookeeper/listener_test.go b/remoting/zookeeper/listener_test.go index b1f0d43d3429a38d8d5e9b5ad804dfecd2ee53c1..845c9a122700724d5b1c34a0a3d798db787837fc 100644 --- a/remoting/zookeeper/listener_test.go +++ b/remoting/zookeeper/listener_test.go @@ -18,7 +18,6 @@ package zookeeper import ( - "fmt" "testing" "time" ) @@ -27,6 +26,7 @@ import ( "github.com/stretchr/testify/assert" ) import ( + "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/remoting" ) @@ -108,10 +108,10 @@ type mockDataListener struct { } func (m *mockDataListener) DataChange(eventType remoting.Event) bool { - fmt.Println(eventType) + logger.Info(eventType) m.eventList = append(m.eventList, eventType) if eventType.Content == m.changedData { - m.client.Wait.Done() + m.client.Close() } return true }