Ocelot 資源彙總
前言
最近一兩年.NET Core的關注度持續上升, 微服務及雲原生應用開發上採用.NET Core也越來越多,Ocelot 作為.NET Core平臺下一款開源的API 閘道器開發庫越來越得到社群的認可,應用到生產中的案例也有好幾百了。春節抽空整理了現有網上公開的Ocelot相關的資源,包括示例專案、擴充套件外掛、部落格文章、視訊等, 供大家參考。
我把整理好的資源放在github: https://github.com/geffzhang/awesome-ocelot ,歡迎大家一起來豐富這個資源,資源來自全世界,所以內容以世界語言英文方式組織。
系列文章
- Developing an Open Source API Gateway at Moonpig
- Designing and implementing API Gateways with Ocelot in .NET Core containers and microservices architectures
- Implement API Gateways with Ocelot
- Building API Gateway Using Ocelot In ASP.NET Core - Basic
- Building API Gateway Using Ocelot In ASP.NET Core - Authentication
- Building API Gateway Using Ocelot In ASP.NET Core - Logging
- Building API Gateway Using Ocelot In ASP.NET Core - Rate Limiting
- Building API Gateway Using Ocelot In ASP.NET Core - QoS (Quality of Service)
- Building API Gateway Using Ocelot In ASP.NET Core - Load Balancing
- Building API Gateway Using Ocelot In ASP.NET Core - Service Discovery (Eureka)
- Microservices with IdentityServer4 and Ocelot Fronting a .NET Core API
- Ocelot簡易教程
- Ocelot API閘道器的實現剖析
- 基於Ocelot的API閘道器實現--http/https協議篇
- 基於Ocelot的API閘道器Relay實現--RPC篇
- .NET Core微服務實戰-統一身份認證 開篇及目錄索引
從系列文章中第一篇是Tom 當時所在的公司 的文章,你可以瞭解到Ocelot的誕生過程,這裡面很多文章都是我們身邊的同學寫的,比如7篇文章雖是英文的,但是你知道他是NCC的專案 https://github.com/dotnetcore/EasyCaching 作者黃文清同學哦,後面的幾篇中文的文章更是把Ocelot如何擴充套件寫的很清楚了。
圖書
目前涉及到Ocelot的圖書只有一本微軟.NET團隊寫的《.NET 微服務:適用於容器化 .NET 應用程式的體系結構》引用的微服務應用程式 eShopOnContainers 使用的是 Ocelot ,這是一個簡單的輕量級 API 閘道器,可與微服務/容器一起部署到任意位置
會議演講
雖然我在社群舉辦過多次活動介紹Ocelot, 錄製有視訊的是2017年我和徐玉濤在微軟Summit 2017上的演講,當時.NET Core 2.0 還是剛釋出,我們當時線上跑的是1.1版本,其中也涉及到了定製Ocelot的內容都是上面的文章中有詳細的文字闡述。
社群專案
- Ocelot Extensions is the project containing some extension to the popular open-source API Gateway engine Ocelot
- Ocelot.Provider.Database
- This library makes ocelot easy to integrate swagger
- SwaggerHelper 工具是在使用 Ocelot 時,為了將多個微服務的 Swagger.json 檔案進行合併,以方便在 API 閘道器中使用 Swagger 工具
- MMLib.SwaggerForOcelot contains swagger extension for ocelot
- Ocelot.JWTAuthorize is a JWT Authorize based on Ocelot API Gateway
- Ocelot.Security.AuthorizationToken.EntityFramework
- grpc service gateway used ocelot
- grpc service gateway used ocelot
- Repo for ZooKeeper integration with Ocelot
- Repo for Etcd integration with Ocelot
- Orleans can use Ocelot Api Gateway
- Ocelot 的配置工具
- A configuration editor for Ocelot
Ocelot 作為一款擴充套件性很強的開發庫,社群中也湧現了很多非常有價值的專案,這些專案都是在生產環境應用過的,讓有定製需求的同學少走很多彎路,這也體現了這個專案的活躍性。
開源貢獻者
Ocelot 現在一起參與貢獻過程式碼的63位,我這裡只列出了在專案中持續活躍的以及對專案有重要貢獻,這個列表我還會持續更新。
示例專案
- FamilyBucket 集合.net core、ocelot、consul、eventbus、configserver、tracing、sqlsugar等構建的微服務一條龍應用示例
- Simple samples that use Ocelot to build API Gateway
- DMS將會是一個集中式的中介軟體框架,每一個小型中介軟體將會是完全獨立的,如:gRPC,Thrift,netty,Wcf,Exceptionless,Ocelot,RabbitMQ,Redis,IdentityServer,Consul,Zookeeper等,Demo中會有每一箇中間件的例項方便開發者瞭解
- 基於Consul + .NET Core + Polly + Ocelot + Exceptionless + IdentityServer等開源專案的微服務開發框架
- Ocelot使用案例,結合IdentityServer4進行鑑權,結合Consul進行服務治理
- 一個基於IdentityServer4和Ocelot的統一驗證與授權ASP.NET Core微服務示例程式專案
- 基於ocelot擴充套件自定義閘道器
- ASP.NET Core 2.2 Web API Gateway Demo
- 集IdentityServer4,Ef Core,dapper,Policy,領域驅動設計,consul,zipkin,Swagger,Cap+RabbitMq,Ocelot閘道器一體的專案
- docker Ocelot Console Identityserver4
- 重寫Ocelot配置檔案獲取方式從資料庫中獲取,並重寫認證以及限流功能。可以針對每個客戶端對每個API的訪問進行限制
相對於擴充套件元件,有很多同學在研究學習Ocelot,以及投入生產專案以示例的形式在github上開源,這些專案不僅僅是圍繞Ocelot,同時圍繞.NET Core的微服務的各個方面都會有涉及,也是大家打造微服務框架的一個參考專案,我這裡節選了github上面的一部分專案,發現這些專案都是中文的,肯定都是我們身邊的同學貢獻的。
視訊
- https://www.youtube.com/watch?v=kl-NeEAb1WQ
- https://www.youtube.com/watch?v=Kvj1g6dLAZw
- Ocelot Api Gateway with ASP.NET Core 2.1 and VS Code
- Tencent updates web and mobile payment infrastructure for better scalability and agility
有幾個視訊都需要藉助梯子,老外做的幾個視訊很不錯,最後一個視訊是微軟和我們一起拍攝的3分鐘的宣傳視訊。
使用者
歡迎大家 在這裡提供你們使用Ocelot的資訊 https://github.com/geffzhang/awesome-ocelot/issues/1 ,據說所知目前Ocelot的使用者案例是很多的,我建立了一個國內的Ocelot使用者的微信群,當前只要列了兩個大使用者。
Ocelot專案的Star 增長圖
截至2019.2.11,Ocelot專案目前有Star 3076個,從上圖可以看出從.NET Core 2.0釋出以來,增長的曲線是一條筆直上升圖,這也側面反應了.NET Core的採用率也在直線上升。