Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3.0' into rm_protoc-gen-dubbo
Browse files Browse the repository at this point in the history
  • Loading branch information
cjphaha committed Jul 10, 2021
2 parents 8bee47d + 52deca0 commit 35abbe1
Show file tree
Hide file tree
Showing 22 changed files with 60 additions and 2,319 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ remoting/zookeeper/zookeeper-4unittest/
config_center/zookeeper/zookeeper-4unittest/
registry/zookeeper/zookeeper-4unittest/
metadata/report/zookeeper/zookeeper-4unittest/
registry/consul/agent*
metadata/report/consul/agent*
remoting/consul/agent*
config_center/apollo/mockDubbog.properties.json

# vim stuff
Expand Down
51 changes: 1 addition & 50 deletions common/constant/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,6 @@ const (
)

const (
CONSUL_KEY = "consul"
CHECK_PASS_INTERVAL = "consul-check-pass-interval"
// default time-to-live in millisecond
DEFAULT_CHECK_PASS_INTERVAL = 16000
QUERY_TAG = "consul_query_tag"
ACL_TOKEN = "acl-token"
// default deregister critical server after
DEFAULT_DEREGISTER_TIME = "20s"
DEREGISTER_AFTER = "consul-deregister-critical-service-after"
// PassThroughProxyFactoryKey is key of proxy factory with raw data input service
PassThroughProxyFactoryKey = "dubbo-raw"
)
Expand All @@ -244,29 +235,13 @@ const (

// Use for router module
const (
// UniformRouterName Specifythe name of UniformRouter
UniformRouterName = "uniform"
// TagRouterName Specify the name of TagRouter
TagRouterName = "tag"
// TagRouterRuleSuffix Specify tag router suffix
TagRouterRuleSuffix = ".tag-router"
RemoteApplicationKey = "remote.application"
TagRouterRuleSuffix = ".tag-router"
// ConditionRouterRuleSuffix Specify condition router suffix
ConditionRouterRuleSuffix = ".condition-router"

// RouterScope Scope key in router module
RouterScope = "scope"
// RouterApplicationScope Scope key in router module
RouterApplicationScope = "application"
// RouterServiceScope Scope key in router module
RouterServiceScope = "service"
// RouterRuleKey defines the key of the router, service's/application's name
RouterRuleKey = "key"
// ForceUseTag is the tag in attachment
ForceUseTag = "dubbo.force.tag"
Tagkey = "dubbo.tag"
// HEALTH_ROUTE_ENABLED_KEY defines if use health router
HEALTH_ROUTE_ENABLED_KEY = "health.route.enabled"
// AttachmentKey in context in invoker
AttachmentKey = DubboCtxKey("attachment")
)
Expand Down Expand Up @@ -314,30 +289,6 @@ const (
METADATA_SERVICE_NAME = "org.apache.dubbo.metadata.MetadataService"
)

// HealthCheck Router
const (
// The key of HealthCheck SPI
HEALTH_CHECKER = "health.checker"
// The name of the default implementation of HealthChecker
DEFAULT_HEALTH_CHECKER = "default"
// The name of the default implementation of C
DEFAULT_CONN_CHECKER = "default"
// The key of outstanding-request-limit\
OUTSTANDING_REQUEST_COUNT_LIMIT_KEY = "outstanding.request.limit"
// The key of successive-failed-request's threshold
SUCCESSIVE_FAILED_REQUEST_THRESHOLD_KEY = "successive.failed.threshold"
// The key of circuit-tripped timeout factor
CIRCUIT_TRIPPED_TIMEOUT_FACTOR_KEY = "circuit.tripped.timeout.factor"
// The default threshold of successive-failed-request if not specfied
DEFAULT_SUCCESSIVE_FAILED_THRESHOLD = 5
// The default maximum diff between successive-failed-request's threshold and actual successive-failed-request's count
DEFAULT_SUCCESSIVE_FAILED_REQUEST_MAX_DIFF = 5
// The default factor of circuit-tripped timeout if not specfied
DEFAULT_CIRCUIT_TRIPPED_TIMEOUT_FACTOR = 1000
// The default time window of circuit-tripped in millisecond if not specfied
MAX_CIRCUIT_TRIPPED_TIMEOUT_IN_MS = 30000
)

// service discovery
const (
SUBSCRIBED_SERVICE_NAMES_KEY = "subscribed-services"
Expand Down
10 changes: 0 additions & 10 deletions config/config_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ const (
// defaultZKAddr is the default registry address of zookeeper
defaultZKAddr = "127.0.0.1:2181"

// defaultConsulAddr is the default registry address of consul
defaultConsulAddr = "127.0.0.1:8500"

// defaultNacosAddr is the default registry address of nacos
defaultNacosAddr = "127.0.0.1:8848"

Expand All @@ -39,7 +36,6 @@ const (
// NewDefaultRegistryConfig New default registry config
// the input @protocol can only be:
// "zookeeper" with default addr "127.0.0.1:2181"
// "consul" with default addr "127.0.0.1:8500"
// "nacos" with default addr "127.0.0.1:8848"
func NewDefaultRegistryConfig(protocol string) *RegistryConfig {
switch protocol {
Expand All @@ -49,12 +45,6 @@ func NewDefaultRegistryConfig(protocol string) *RegistryConfig {
Address: defaultZKAddr,
TimeoutStr: defaultRegistryTimeout,
}
case "consul":
return &RegistryConfig{
Protocol: protocol,
Address: defaultConsulAddr,
TimeoutStr: defaultRegistryTimeout,
}
case "nacos":
return &RegistryConfig{
Protocol: protocol,
Expand Down
11 changes: 1 addition & 10 deletions config/config_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ func TestNewProviderConfig(t *testing.T) {
WithServiceWarmUpTime("test-warmup"),
)

defaultConsulRegistry := NewDefaultRegistryConfig("consul")
assert.Equal(t, defaultConsulRegistry.Address, defaultConsulAddr)
assert.Equal(t, defaultConsulRegistry.Protocol, "consul")
assert.Equal(t, defaultConsulRegistry.TimeoutStr, defaultRegistryTimeout)

defaultNacosRegistry := NewDefaultRegistryConfig("nacos")
assert.Equal(t, defaultNacosRegistry.Address, defaultNacosAddr)
assert.Equal(t, defaultNacosRegistry.Protocol, "nacos")
Expand All @@ -151,7 +146,7 @@ func TestNewProviderConfig(t *testing.T) {
testProviderConfig := NewProviderConfig(
WithProviderServices("UserProvider", serviceConfig),
WithProviderProtocol("dubbo", "dubbo", "20000"),
WithProviderRegistry("demoConsul", defaultConsulRegistry),
WithProviderRegistry("demoNacos", defaultNacosRegistry),
)

assert.NotNil(t, testProviderConfig.Services)
Expand All @@ -161,10 +156,6 @@ func TestNewProviderConfig(t *testing.T) {
}
assert.NotNil(t, testProviderConfig.Registries)

if registry, ok := testProviderConfig.Registries["demoConsul"]; ok {
assert.Equal(t, registry, defaultConsulRegistry)
}

if registry, ok := testProviderConfig.Registries["demoNacos"]; ok {
assert.Equal(t, registry, defaultNacosRegistry)
}
Expand Down
21 changes: 1 addition & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ module dubbo.apache.org/dubbo-go/v3
go 1.15

require (
cloud.google.com/go v0.50.0 // indirect
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/RoaringBitmap/roaring v0.7.1
github.com/Workiva/go-datastructures v1.0.52
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
github.com/alibaba/sentinel-golang v1.0.2
github.com/apache/dubbo-getty v1.4.4
github.com/apache/dubbo-getty v1.4.3
github.com/apache/dubbo-go-hessian2 v1.9.2
github.com/creasty/defaults v1.5.1
github.com/docker/go-connections v0.4.0 // indirect
github.com/dubbogo/go-zookeeper v1.0.3
github.com/dubbogo/gost v1.11.13
github.com/dubbogo/triple v1.0.1
Expand All @@ -25,20 +21,10 @@ require (
github.com/go-resty/resty/v2 v2.3.0
github.com/golang/mock v1.4.4
github.com/golang/protobuf v1.5.2
github.com/gophercloud/gophercloud v0.3.0 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
github.com/hashicorp/consul v1.8.0
github.com/hashicorp/consul/api v1.5.0
github.com/hashicorp/go-raftchunking v0.6.3-0.20191002164813-7e9e8525653a // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/hashicorp/vault/api v1.0.5-0.20191108163347-bdd38fca2cff // indirect
github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267
github.com/imdario/mergo v0.3.9 // indirect
github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8
github.com/linode/linodego v0.10.0 // indirect
github.com/magiconair/properties v1.8.5
github.com/miekg/dns v1.1.27 // indirect
github.com/mitchellh/hashstructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.1
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
github.com/nacos-group/nacos-sdk-go v1.0.8
Expand All @@ -62,8 +48,3 @@ require (
k8s.io/client-go v0.16.9
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect
)

replace (
github.com/envoyproxy/go-control-plane => github.com/envoyproxy/go-control-plane v0.8.0
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)

0 comments on commit 35abbe1

Please sign in to comment.