Skip to content
Snippets Groups Projects
Commit 24e7d6f0 authored by 高辛格's avatar 高辛格
Browse files

Merge branch 'develop' into consul

parents 803c1b2b 6614d23b
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,6 @@ import ( ...@@ -29,7 +29,6 @@ import (
"github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/common/utils" "github.com/apache/dubbo-go/common/utils"
"github.com/apache/dubbo-go/protocol" "github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/version"
) )
type baseClusterInvoker struct { type baseClusterInvoker struct {
...@@ -66,8 +65,8 @@ func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, in ...@@ -66,8 +65,8 @@ func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, in
if len(invokers) == 0 { if len(invokers) == 0 {
ip, _ := utils.GetLocalIP() ip, _ := utils.GetLocalIP()
return perrors.Errorf("Failed to invoke the method %v. No provider available for the service %v from "+ return perrors.Errorf("Failed to invoke the method %v. No provider available for the service %v from "+
"registry %v on the consumer %v using the dubbo version %v .Please check if the providers have been started and registered.", "registry %v on the consumer %v using the dubbo constant %v .Please check if the providers have been started and registered.",
invocation.MethodName(), invoker.directory.GetUrl().SubURL.Key(), invoker.directory.GetUrl().String(), ip, version.Version) invocation.MethodName(), invoker.directory.GetUrl().SubURL.Key(), invoker.directory.GetUrl().String(), ip, constant.Version)
} }
return nil return nil
...@@ -77,8 +76,8 @@ func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, in ...@@ -77,8 +76,8 @@ func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, in
func (invoker *baseClusterInvoker) checkWhetherDestroyed() error { func (invoker *baseClusterInvoker) checkWhetherDestroyed() error {
if invoker.destroyed.Load() { if invoker.destroyed.Load() {
ip, _ := utils.GetLocalIP() ip, _ := utils.GetLocalIP()
return perrors.Errorf("Rpc cluster invoker for %v on consumer %v use dubbo version %v is now destroyed! can not invoke any more. ", return perrors.Errorf("Rpc cluster invoker for %v on consumer %v use dubbo constant %v is now destroyed! can not invoke any more. ",
invoker.directory.GetUrl().Service(), ip, version.Version) invoker.directory.GetUrl().Service(), ip, constant.Version)
} }
return nil return nil
} }
......
...@@ -26,7 +26,6 @@ import ( ...@@ -26,7 +26,6 @@ import (
"github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/utils" "github.com/apache/dubbo-go/common/utils"
"github.com/apache/dubbo-go/protocol" "github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/version"
) )
type failoverClusterInvoker struct { type failoverClusterInvoker struct {
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package constant
const (
Version = "2.6.0"
Name = "dubbogo"
DATE = "2019/05/06"
)
...@@ -28,7 +28,6 @@ import ( ...@@ -28,7 +28,6 @@ import (
"github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/version"
) )
var ( var (
...@@ -93,7 +92,7 @@ func Load() { ...@@ -93,7 +92,7 @@ func Load() {
checkok = false checkok = false
count++ count++
if count > maxWait { if count > maxWait {
panic(fmt.Sprintf("Failed to check the status of the service %v . No provider available for the service to the consumer use dubbo version %v", refconfig.InterfaceName, version.Version)) panic(fmt.Sprintf("Failed to check the status of the service %v . No provider available for the service to the consumer use dubbo constant %v", refconfig.InterfaceName, constant.Version))
} }
time.Sleep(time.Second * 1) time.Sleep(time.Second * 1)
break break
......
...@@ -23,7 +23,6 @@ import ( ...@@ -23,7 +23,6 @@ import (
"github.com/apache/dubbo-go/common/utils" "github.com/apache/dubbo-go/common/utils"
"github.com/apache/dubbo-go/registry" "github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting/etcdv3" "github.com/apache/dubbo-go/remoting/etcdv3"
"github.com/apache/dubbo-go/version"
) )
var ( var (
...@@ -229,7 +228,7 @@ func (r *etcdV3Registry) registerConsumer(svc common.URL) error { ...@@ -229,7 +228,7 @@ func (r *etcdV3Registry) registerConsumer(svc common.URL) error {
params.Add("protocol", svc.Protocol) params.Add("protocol", svc.Protocol)
params.Add("category", (common.RoleType(common.CONSUMER)).String()) params.Add("category", (common.RoleType(common.CONSUMER)).String())
params.Add("dubbo", "dubbogo-consumer-"+version.Version) params.Add("dubbo", "dubbogo-consumer-"+constant.Version)
encodedURL := url.QueryEscape(fmt.Sprintf("consumer://%s%s?%s", localIP, svc.Path, params.Encode())) encodedURL := url.QueryEscape(fmt.Sprintf("consumer://%s%s?%s", localIP, svc.Path, params.Encode()))
dubboPath := fmt.Sprintf("/dubbo/%s/%s", svc.Service(), (common.RoleType(common.CONSUMER)).String()) dubboPath := fmt.Sprintf("/dubbo/%s/%s", svc.Service(), (common.RoleType(common.CONSUMER)).String())
...@@ -266,7 +265,7 @@ func (r *etcdV3Registry) registerProvider(svc common.URL) error { ...@@ -266,7 +265,7 @@ func (r *etcdV3Registry) registerProvider(svc common.URL) error {
params.Add("ip", localIP) params.Add("ip", localIP)
params.Add("anyhost", "true") params.Add("anyhost", "true")
params.Add("category", (common.RoleType(common.PROVIDER)).String()) params.Add("category", (common.RoleType(common.PROVIDER)).String())
params.Add("dubbo", "dubbo-provider-golang-"+version.Version) params.Add("dubbo", "dubbo-provider-golang-"+constant.Version)
params.Add("side", (common.RoleType(common.PROVIDER)).Role()) params.Add("side", (common.RoleType(common.PROVIDER)).Role())
if len(svc.Methods) == 0 { if len(svc.Methods) == 0 {
......
...@@ -41,7 +41,6 @@ import ( ...@@ -41,7 +41,6 @@ import (
"github.com/apache/dubbo-go/common/utils" "github.com/apache/dubbo-go/common/utils"
"github.com/apache/dubbo-go/registry" "github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting/zookeeper" "github.com/apache/dubbo-go/remoting/zookeeper"
"github.com/apache/dubbo-go/version"
) )
const ( const (
...@@ -304,7 +303,7 @@ func (r *zkRegistry) register(c common.URL) error { ...@@ -304,7 +303,7 @@ func (r *zkRegistry) register(c common.URL) error {
// DubboRole = [...]string{"consumer", "", "", "provider"} // DubboRole = [...]string{"consumer", "", "", "provider"}
// params.Add("category", (RoleType(PROVIDER)).Role()) // params.Add("category", (RoleType(PROVIDER)).Role())
params.Add("category", (common.RoleType(common.PROVIDER)).String()) params.Add("category", (common.RoleType(common.PROVIDER)).String())
params.Add("dubbo", "dubbo-provider-golang-"+version.Version) params.Add("dubbo", "dubbo-provider-golang-"+constant.Version)
params.Add("side", (common.RoleType(common.PROVIDER)).Role()) params.Add("side", (common.RoleType(common.PROVIDER)).Role())
...@@ -347,7 +346,7 @@ func (r *zkRegistry) register(c common.URL) error { ...@@ -347,7 +346,7 @@ func (r *zkRegistry) register(c common.URL) error {
params.Add("protocol", c.Protocol) params.Add("protocol", c.Protocol)
params.Add("category", (common.RoleType(common.CONSUMER)).String()) params.Add("category", (common.RoleType(common.CONSUMER)).String())
params.Add("dubbo", "dubbogo-consumer-"+version.Version) params.Add("dubbo", "dubbogo-consumer-"+constant.Version)
rawURL = fmt.Sprintf("consumer://%s%s?%s", localIP, c.Path, params.Encode()) rawURL = fmt.Sprintf("consumer://%s%s?%s", localIP, c.Path, params.Encode())
encodedURL = url.QueryEscape(rawURL) encodedURL = url.QueryEscape(rawURL)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment