Skip to content

Commit

Permalink
Merge pull request #70 from hb-chen/master
Browse files Browse the repository at this point in the history
update mod
  • Loading branch information
hb-chen authored May 26, 2020
2 parents fb743c5 + af3e5b7 commit 02793a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
- 发布
- [x] 灰度
- [x] 蓝绿
- *注:由于 micro 默认的 api 和 web 网关均不支持**服务筛选**,需要自己改造,方案参考[微服务协作开发、灰度发布之流量染色](https://micro.mu/blog/cn/2019/12/09/go-micro-service-chain.html),此方案仅适用于测试,具体 asim 在 [PR#1388](https://github.com/micro/go-micro/pull/1388) 给了反馈,但可以自定义 Router 实现*
- *注:由于 micro 默认的 api 和 web 网关均不支持**服务筛选**,需要自己改造,方案参考[微服务协作开发、灰度发布之流量染色](http://hbchen.com/post/microservice/2019-11-30-go-micro-service-chain/),此方案仅适用于测试,具体 asim 在 [PR#1388](https://github.com/micro/go-micro/pull/1388) 给了反馈,但可以自定义 Router 实现*
- 自定义 Router 实现网关对服务筛选的支持,因为 micro 有 internal 库所以需要在 micro 内实现,参考我 fork 的分支版本 [hb-chen/micro/gateway](https://github.com/hb-chen/micro/tree/gateway-2.4.0/gateway),[gateway](gateway) 模块使用的便是此方案,可以快速实现流量染色
- 部署
- K8S
Expand Down Expand Up @@ -174,7 +174,7 @@
**真实场景**

- 考虑所有服务都可以自助路由到本地,不能直接使用`Micro-Router`(因为`Micro-Router`会在全链路生效),可以自定义`header`来定义`router`筛选的应用范围,通过`Client/Call Wrap`实现,参考实现[router_filter](/pkg/plugin/wrapper/client/router_filter)
- 要做到`api`服务可以路由筛选,在网关层与[流量染色](https://micro.mu/blog/cn/2019/12/09/go-micro-service-chain.html)有相同的问题,不支持**服务筛选**,导致的代理服务被忽略,需要去掉`SelectOption`
- 要做到`api`服务可以路由筛选,在网关层与[流量染色](http://hbchen.com/post/microservice/2019-11-30-go-micro-service-chain/)有相同的问题,不支持**服务筛选**,导致的代理服务被忽略,需要去掉`SelectOption`
- 另一个方案是在本地开`micro api` + `聚合服务`,聚合服务再通过`network`代理访问线上服务,可以满足一般场景的需求
- 网关及服务全部使用`network`做代理

Expand Down
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ require (
contrib.go.opencensus.io/exporter/jaeger v0.2.0
contrib.go.opencensus.io/exporter/stackdriver v0.12.1
github.com/ajg/form v1.5.1 // indirect
github.com/alibaba/sentinel-golang v0.2.0
github.com/astaxie/beego v1.12.0
github.com/casbin/casbin/v2 v2.1.2
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/envoyproxy/protoc-gen-validate v0.1.0
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 // indirect
github.com/gin-gonic/gin v1.3.0
github.com/gin-gonic/gin v1.5.0
github.com/go-sql-driver/mysql v1.4.1
github.com/golang/protobuf v1.3.5
github.com/google/uuid v1.1.1
Expand All @@ -30,7 +30,7 @@ require (
github.com/micro-in-cn/x-gateway v0.0.0-20200218113529-54c68df17b84
github.com/micro/cli/v2 v2.1.2
github.com/micro/go-micro v1.18.1-0.20200110215436-f50a50eeb36a
github.com/micro/go-micro/v2 v2.4.0
github.com/micro/go-micro/v2 v2.4.1-0.20200413220547-71d4253927cc
github.com/micro/go-plugins/logger/zap/v2 v2.3.0
github.com/micro/go-plugins/registry/kubernetes/v2 v2.0.0-20200317215710-66384449b09c
github.com/micro/go-plugins/transport/tcp/v2 v2.0.0-20200317215710-66384449b09c
Expand All @@ -42,7 +42,6 @@ require (
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/smartystreets/assertions v1.0.1 // indirect
github.com/smartystreets/goconvey v0.0.0-20190710185942-9d28bd7c0945 // indirect
github.com/stretchr/testify v1.4.0
github.com/uber/jaeger-client-go v2.21.1+incompatible
github.com/uber/jaeger-lib v2.2.0+incompatible
Expand All @@ -53,11 +52,11 @@ require (
github.com/yudai/pp v2.0.1+incompatible // indirect
go.opencensus.io v0.22.2
go.uber.org/dig v1.9.0
go.uber.org/zap v1.13.0
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
google.golang.org/grpc v1.26.0
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
xorm.io/xorm v0.8.0
)

replace github.com/micro/micro/v2 v2.4.0 => github.com/hb-chen/micro/v2 v2.4.0
replace github.com/micro/micro/v2 v2.4.0 => github.com/hb-chen/micro/v2 v2.0.0-20200414123212-977f933825b7

0 comments on commit 02793a4

Please sign in to comment.