Skip to content
Snippets Groups Projects
Commit f9e9c453 authored by fangyincheng's avatar fangyincheng
Browse files

merge master

parents 3dc7610f 1d86a218
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ Finished List:
- Transport: HTTP, TCP
- Codec: JsonRPC v2, Hessian v2
- Registry: ZooKeeper/[etcd v3](https://github.com/apache/dubbo-go/pull/148)/[nacos](https://github.com/apache/dubbo-go/pull/151)/[consul](https://github.com/apache/dubbo-go/pull/121)
- Configure Center: Zookeeper
- Dynamic Configure Center & Service Management Configurator: Zookeeper
- Cluster Strategy: Failover/[Failfast](https://github.com/apache/dubbo-go/pull/140)/[Failsafe/Failback](https://github.com/apache/dubbo-go/pull/136)/[Available](https://github.com/apache/dubbo-go/pull/155)/[Broadcast](https://github.com/apache/dubbo-go/pull/158)/[Forking](https://github.com/apache/dubbo-go/pull/161)
- Load Balance: Random/[RoundRobin](https://github.com/apache/dubbo-go/pull/66)/[LeastActive](https://github.com/apache/dubbo-go/pull/65)
- Filter: Echo Health Check/[Circuit break and service downgrade](https://github.com/apache/dubbo-go/pull/133)/[TokenFilter](https://github.com/apache/dubbo-go/pull/202)/[AccessLogFilter](https://github.com/apache/dubbo-go/pull/214)
......@@ -43,7 +43,7 @@ Working List:
- Filter: CountFilter/ExecuteLimitFilter/TpsLimitFilter
- Registry: k8s
- Configure Center: apollo
- Dynamic Configuration Center & Metadata Center (dubbo v2.7.x)
- Metadata Center (dubbo v2.7.x)
- Metrics: Promethus(dubbo v2.7.x)
Todo List:
......@@ -64,6 +64,19 @@ TODO
## Running unit tests
### Prepare
Mac/Linux
```bash
sh ./before_ut.sh
```
Windows
```bash
before_ut.bat
```
# Run
```bash
go test ./...
......
......@@ -30,7 +30,7 @@ Apache License, Version 2.0
- 传输协议: HTTP, TCP
- 序列化协议: JsonRPC v2, Hessian v2
- 注册中心: ZooKeeper/[etcd v3](https://github.com/apache/dubbo-go/pull/148)/[nacos](https://github.com/apache/dubbo-go/pull/151)/[consul](https://github.com/apache/dubbo-go/pull/121)
- 配置中心: Zookeeper
- 动态配置中心与服务治理配置器(config center): Zookeeper
- 集群策略: Failover/[Failfast](https://github.com/apache/dubbo-go/pull/140)/[Failsafe/Failback](https://github.com/apache/dubbo-go/pull/136)/[Available](https://github.com/apache/dubbo-go/pull/155)/[Broadcast](https://github.com/apache/dubbo-go/pull/158)/[Forking](https://github.com/apache/dubbo-go/pull/161)
- 负载均衡策略: Random/[RoundRobin](https://github.com/apache/dubbo-go/pull/66)/[LeastActive](https://github.com/apache/dubbo-go/pull/65)
- 过滤器: Echo Health Check/[服务熔断&降级](https://github.com/apache/dubbo-go/pull/133)/[TokenFilter](https://github.com/apache/dubbo-go/pull/202)/[AccessLogFilter](https://github.com/apache/dubbo-go/pull/214)
......@@ -43,7 +43,7 @@ Apache License, Version 2.0
- 过滤器: CountFilter/ExecuteLimitFilter/TpsLimitFilter
- 注册中心: k8s
- 配置中心: apollo
- 动态配置中心 & 元数据中心 (dubbo v2.7.x)
- 元数据中心 (dubbo v2.7.x)
- Metrics: Promethus(dubbo v2.7.x)
任务列表:
......@@ -64,10 +64,23 @@ TODO
## 运行单测
### 准备
Mac/Linux
```bash
sh ./before_ut.sh
```
Windows
```bash
before_ut.bat
```
# 执行
```bash
go test ./...
# 覆盖率
# coverage
go test ./... -coverprofile=coverage.txt -covermode=atomic
```
......
set zkJar=zookeeper-3.4.9-fatjar.jar
md remoting\zookeeper\zookeeper-4unittest\contrib\fatjar config_center\zookeeper\zookeeper-4unittest\contrib\fatjar registry\zookeeper\zookeeper-4unittest\contrib\fatjar
curl -L https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/%zkJar% -o remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/%zkJar%
xcopy /f "remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/%zkJar%" "config_center/zookeeper/zookeeper-4unittest/contrib/fatjar/"
xcopy /f "remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/%zkJar%" "registry/zookeeper/zookeeper-4unittest/contrib/fatjar/"
\ No newline at end of file
......@@ -38,6 +38,7 @@ import (
"github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/protocolwrapper"
"github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting"
)
type Options struct {
......@@ -119,20 +120,19 @@ func (dir *registryDirectory) refreshInvokers(res *registry.ServiceEvent) {
url = nil
//TODO: router
}
switch res.Action {
case remoting.EventTypeAdd, remoting.EventTypeUpdate:
//dir.cacheService.EventTypeAdd(res.Path, dir.serviceTTL)
dir.cacheInvoker(url)
case remoting.EventTypeDel:
//dir.cacheService.EventTypeDel(res.Path, dir.serviceTTL)
dir.uncacheInvoker(url)
logger.Infof("selector delete service url{%s}", res.Service)
default:
return
}
}
//
//switch res.Action {
//case remoting.EventTypeAdd:
// //dir.cacheService.EventTypeAdd(res.Path, dir.serviceTTL)
// dir.cacheInvoker(&res.Service)
//case remoting.EventTypeDel:
// //dir.cacheService.EventTypeDel(res.Path, dir.serviceTTL)
// dir.uncacheInvoker(&res.Service)
// logger.Infof("selector delete service url{%s}", res.Service)
//default:
// return
//}
dir.cacheInvoker(url)
newInvokers := dir.toGroupInvokers()
dir.listenerLock.Lock()
defer dir.listenerLock.Unlock()
......
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