前言

最近一两年.NET Core的关注度持续上升, 微服务及云原生应用开发上采用.NET Core也越来越多,Ocelot 作为.NET
Core平台下一款开源的API
网关开发库越来越得到社区的认可,应用到生产中的案例也有好几百了。春节抽空整理了现有网上公开的Ocelot相关的资源,包括示例项目、扩展插件、博客文章、视频等,
供大家参考。

我把整理好的资源放在github:https://github.com/geffzhang/awesome-ocelot
<https://github.com/geffzhang/awesome-ocelot>
,欢迎大家一起来丰富这个资源,资源来自全世界,所以内容以世界语言英文方式组织。




系列文章

* Developing an Open Source API Gateway at Moonpig
<https://engineering.moonpig.com/development/developing-open-source-api-gateway-moonpig>
* Designing and implementing API Gateways with Ocelot in .NET Core containers
and microservices architectures
<https://blogs.msdn.microsoft.com/cesardelatorre/2018/05/15/designing-and-implementing-api-gateways-with-ocelot-in-a-microservices-and-container-based-architecture/>
* Implement API Gateways with Ocelot
<https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/implement-api-gateways-with-ocelot>
* Building API Gateway Using Ocelot In ASP.NET Core - Basic
<http://www.c-sharpcorner.com/article/building-api-gateway-using-ocelot-in-asp-net-core/>
* Building API Gateway Using Ocelot In ASP.NET Core - Authentication
<http://www.c-sharpcorner.com/article/building-api-gateway-using-ocelot-in-asp-net-core-part-two/>
* Building API Gateway Using Ocelot In ASP.NET Core - Logging
<http://www.c-sharpcorner.com/article/building-api-gateway-using-ocelot-in-asp-net-core-part-three-logging2/>
* Building API Gateway Using Ocelot In ASP.NET Core - Rate Limiting
<http://www.c-sharpcorner.com/article/building-api-gateway-using-ocelot-in-asp-net-core-rate-limiting-part-four/>
* Building API Gateway Using Ocelot In ASP.NET Core - QoS (Quality of Service)

<https://www.c-sharpcorner.com/article/building-api-gateway-using-ocelot-in-asp-net-core-qos/>
* Building API Gateway Using Ocelot In ASP.NET Core - Load Balancing
<https://www.c-sharpcorner.com/article/building-api-gateway-using-ocelot-in-asp-net-core-load-balancing/>
* Building API Gateway Using Ocelot In ASP.NET Core - Service Discovery
(Eureka)
<https://www.c-sharpcorner.com/article/building-api-gateway-using-ocelot-in-asp-net-core-service-discoveryeureka/>
* Microservices with IdentityServer4 and Ocelot Fronting a .NET Core API
<https://squarewidget.com/microservices-with-identityserver4-and-ocelot-fronting-a-net-core-api/>
* Ocelot简易教程 <https://github.com/yilezhu/OcelotDemo/wiki>
* Ocelot API网关的实现剖析 <https://www.cnblogs.com/shanyou/p/7787183.html>
* 基于Ocelot的API网关实现--http/https协议篇
<https://www.cnblogs.com/SteveLee/p/Ocelot_Api_http_and_https.html>
* 基于Ocelot的API网关Relay实现--RPC篇
<https://www.cnblogs.com/SteveLee/p/Ocelot_Api_http_route_RPC.html>
* .NET Core微服务实战-统一身份认证 开篇及目录索引
<https://www.cnblogs.com/jackcao/p/9928879.html>



从系列文章中第一篇是Tom 当时所在的公司
的文章,你可以了解到Ocelot的诞生过程,这里面很多文章都是我们身边的同学写的,比如7篇文章虽是英文的,但是你知道他是NCC的项目
https://github.com/dotnetcore/EasyCaching
<https://github.com/dotnetcore/EasyCaching>
作者黄文清同学哦,后面的几篇中文的文章更是把Ocelot如何扩展写的很清楚了。




图书

* .NET Microservices Architecture Guidance
<https://dotnet.microsoft.com/learn/web/microservices-architecture>
目前涉及到Ocelot的图书只有一本微软.NET团队写的《.NET 微服务:适用于容器化 .NET 应用程序的体系结构》引用的微服务应用程序
eShopOnContainers <https://github.com/dotnet-architecture/eShopOnContainers>
使用的是Ocelot <https://github.com/ThreeMammals/Ocelot>,这是一个简单的轻量级 API
网关,可与微服务/容器一起部署到任意位置




会议演讲

* .NET Core 在腾讯财付通的企业级应用开发实践
<https://v.qq.com/iframe/player.html?vid=c0508ti8mxo>
虽然我在社区举办过多次活动介绍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
<https://github.com/childotg/Ocelot.Extensions>
* Ocelot.Provider.Database
<https://github.com/tianxin8206/Ocelot.Provider.Database>
* This library makes ocelot easy to integrate swagger
<https://github.com/Rwing/OcelotSwagger>
* SwaggerHelper 工具是在使用 Ocelot 时,为了将多个微服务的 Swagger.json 文件进行合并,以方便在 API 网关中使用
Swagger 工具 <https://github.com/ZhongruiGroup/Swagger-Helper>
* MMLib.SwaggerForOcelot contains swagger extension for ocelot
<https://github.com/Burgyn/MMLib.SwaggerForOcelot>
* Ocelot.JWTAuthorize is a JWT Authorize based on Ocelot API Gateway
<https://github.com/axzxs2001/Ocelot.JWTAuthorize>
* Ocelot.Security.AuthorizationToken.EntityFramework
<https://github.com/aqa510415008/Ocelot.Security.AuthorizationToken.EntityFramework>
* grpc service gateway used ocelot
<https://github.com/BuiltCloud/Ocelot.GrpcHttpGateway>
* grpc service gateway used ocelot
<https://github.com/yuezhishun/Ocelot.GrpcHttpGateway>
* Repo for ZooKeeper integration with Ocelot
<https://github.com/BuiltCloud/Ocelot.Provider.ZooKeeper>
* Repo for Etcd integration with Ocelot
<https://github.com/BuiltCloud/Ocelot.Provider.Etcd>
* Orleans can use Ocelot Api Gateway
<https://github.com/aqa510415008/Ocelot.OrleansHttpGateway>
* Ocelot 的配置工具 <https://github.com/JustWei-OST/Ocelot.Configurator>
* A configuration editor for Ocelot
<https://github.com/dbarkwell/Ocelot.ConfigEditor>
Ocelot
作为一款扩展性很强的开发库,社区中也涌现了很多非常有价值的项目,这些项目都是在生产环境应用过的,让有定制需求的同学少走很多弯路,这也体现了这个项目的活跃性。




开源贡献者

* Tom Pallister <https://github.com/TomPallister>
* Philip Wood <https://github.com/binarymash>
* geffzhang <https://github.com/geffzhang>
* 阿凌 <https://github.com/aqa510415008>
* Phil Proctor <https://github.com/philproctor>
* Thiago Loureiro <https://github.com/thiagoloureiro>
* Felix Boers <https://github.com/FelixBoers>
* Marcelo Castagna <https://github.com/margaale>
Ocelot 现在一起参与贡献过代码的63位,我这里只列出了在项目中持续活跃的以及对项目有重要贡献,这个列表我还会持续更新。




示例项目

* FamilyBucket 集合.net
core、ocelot、consul、eventbus、configserver、tracing、sqlsugar等构建的微服务一条龙应用示例
<https://github.com/q315523275/FamilyBucket>
* Simple samples that use Ocelot to build API Gateway
<https://github.com/catcherwong-archive/APIGatewayDemo>
*
DMS将会是一个集中式的中间件框架,每一个小型中间件将会是完全独立的,如:gRPC,Thrift,netty,Wcf,Exceptionless,Ocelot,RabbitMQ,Redis,IdentityServer,Consul,Zookeeper等,Demo中会有每一个中间件的实例方便开发者了解
<https://github.com/hailang2ll/DMS>
* 基于Consul + .NET Core + Polly + Ocelot + Exceptionless +
IdentityServer等开源项目的微服务开发框架 <https://github.com/geffzhang/NanoFabric>
* Ocelot使用案例,结合IdentityServer4进行鉴权,结合Consul进行服务治理
<https://github.com/ShaoHans/OcelotSample>
* 一个基于IdentityServer4和Ocelot的统一验证与授权ASP.NET Core微服务示例程序项目
<https://github.com/EdisonChou/IdentityService.Sample.DotNetCore>
* 基于ocelot扩展自定义网关 <https://github.com/jinyancao/czar.gateway>
* ASP.NET Core 2.2 Web API Gateway Demo
<https://github.com/matjazbravc/AspNetCore-Api-Gateway-Demo>
* 集IdentityServer4,Ef
Core,dapper,Policy,领域驱动设计,consul,zipkin,Swagger,Cap+RabbitMq,Ocelot网关一体的项目
<https://github.com/476515159/IdentityServer4Sample>
* docker Ocelot Console Identityserver4
<https://github.com/cysnet/docker-microserver>
* 重写Ocelot配置文件获取方式从数据库中获取,并重写认证以及限流功能。可以针对每个客户端对每个API的访问进行限制
<https://github.com/yilezhu/Ocelot.ConfigAuthLimitCache>



相对于扩展组件,有很多同学在研究学习Ocelot,以及投入生产项目以示例的形式在github上开源,这些项目不仅仅是围绕Ocelot,同时围绕.NET
Core的微服务的各个方面都会有涉及,也是大家打造微服务框架的一个参考项目,我这里节选了github上面的一部分项目,发现这些项目都是中文的,肯定都是我们身边的同学贡献的。




视频




* https://www.youtube.com/watch?v=kl-NeEAb1WQ
<https://www.youtube.com/watch?v=kl-NeEAb1WQ>
* https://www.youtube.com/watch?v=Kvj1g6dLAZw
<https://www.youtube.com/watch?v=Kvj1g6dLAZw>
* Ocelot Api Gateway with ASP.NET Core 2.1 and VS Code
<https://codango.com/ocelot-api-gateway-with-asp-net-core-2-1-and-vs-code/>
* Tencent updates web and mobile payment infrastructure for better
scalability and agility
<http://videos.microsoft.com/customer-stories/watch/Ub3bRAkE76CkemSfXkioug>


有几个视频都需要借助梯子,老外做的几个视频很不错,最后一个视频是微软和我们一起拍摄的3分钟的宣传视频。




用户




欢迎大家 在这里提供你们使用Ocelot的信息 https://github.com/geffzhang/awesome-ocelot/issues/1
<https://github.com/geffzhang/awesome-ocelot/issues/1>
,据说所知目前Ocelot的用户案例是很多的,我创建了一个国内的Ocelot用户的微信群,当前只要列了两个大用户。







Ocelot项目的Star 增长图


<https://img2018.cnblogs.com/blog/510/201902/510-20190211221021348-1211554126.png>




截至2019.2.11,Ocelot项目目前有Star 3076个,从上图可以看出从.NET Core
2.0发布以来,增长的曲线是一条笔直上升图,这也侧面反应了.NET Core的采用率也在直线上升。

友情链接
ioDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信