項目介紹
1、各種方式連接API都會連接到 APIGateway 來進行統一的分發 Ocelot
2、當api需要授權時 需要請求授權服務 IdentityServer4
3、授權服務對請求進行調用user.api 驗證
4、user.api驗證結果返回
5、授權服務返回token信息或授權失敗
6、攜帶token訪問user.api
7、user.api返回結果 (401,403是未授權)
8、訪問不需要授權的user.api
9、api之間的交互 Polly
10、api之間通過EventBus交互RabbitMQ Publish RabbitMQ CAP
11、api之間通過EventBus交互RabbitMQ Subscribe
12、Consul進行整個微服務的注冊和發現 Consul
13、數據庫 Sqlserver MySQL Redis MongoDB
14、部署Linux 使用docker容器化微服務 Nginx發布 Ubuntu Docker Nginx
參考文檔
Ocelot文檔 https://ocelot.readthedocs.io/en/latest/index.html
IdentityServer4文檔 http://docs.identityserver.io/en/latest/
Polly 文檔 https://github.com/App-vNext/Polly/wiki
RabbitMQ 文檔 https://www.rabbitmq.com/tutorials/tutorial-one-dotnet.html
其他參考抽空整理(或者寫在之后的具體模塊博客中)
視頻推薦
solenovex 博客 https://www.cnblogs.com/cgzl/category/1090036.html (bilibili 搜名字有.net core 教學視頻 頂)
jessetalk 視頻 http://video.jessetalk.cn/ (我的項目就是按照他的視頻開發的)
現在我也在邊學習邊整理的狀態 可以按照上面的視頻教學 配合這官方文檔一起學習
我已經做了一部分了
https://github.com/Henry-Net/NewDistributedProject
項目運行的話吧所有里面的地址和端口改一下 並且user.api 的交互可能報錯 因為需要安裝consul