前言
最近一两年. 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 简易教程 https://github.com/yilezhu/OcelotDemo/wiki
Ocelot API 网关的实现剖析
基于 Ocelot 的 API 网关实现 --http/https 协议篇
基于 Ocelot 的 API 网关 Relay 实现 --RPC 篇
.NET Core 微服务实战 - 统一身份认证 开篇及目录索引
从系列文章中第一篇是 Tom 当时所在的公司 的文章, 你可以了解到 Ocelot 的诞生过程, 这里面很多文章都是我们身边的同学写的, 比如 7 篇文章虽是英文的, 但是你知道他是 NCC 的项目 https://github.com/dotnetcore/EasyCaching 作者黄文清同学哦, 后面的几篇中文的文章更是把 Ocelot 如何扩展写的很清楚了.
图书
.NET Microservices Architecture Guidance
目前涉及到 Ocelot 的图书只有一本微软. NET 团队写的《.NET 微服务: 适用于容器化 .NET 应用程序的体系结构》引用的微服务应用程序 使用的是 https://github.com/ThreeMammals/Ocelot , 这是一个简单的轻量级 API 网关, 可与微服务 / 容器一起部署到任意位置
会议演讲
.NET Core 在腾讯财付通的企业级应用开发实践
虽然我在社区举办过多次活动介绍 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
- 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
- grpc service gateway used ocelot
- grpc service gateway used ocelot
- Repo for ZooKeeper integration with Ocelot
- Repo for Etcd integration with Ocelot https://github.com/BuiltCloud/Ocelot.Provider.Etcd
- Orleans can use Ocelot API Gateway
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
- 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
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 微服务示例程序项目
基于 ocelot 扩展自定义网关 https://github.com/jinyancao/czar.gateway
ASP.NET Core 2.2 web 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 的访问进行限制
相对于扩展组件, 有很多同学在研究学习 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 的信息 , 据说所知目前 Ocelot 的用户案例是很多的, 我创建了一个国内的 Ocelot 用户的微信群, 当前只要列了两个大用户.
Ocelot 项目的 Star 增长图
截至 2019.2.11,Ocelot 项目目前有 Star 3076 个, 从上图可以看出从. NET Core 2.0 发布以来, 增长的曲线是一条笔直上升图, 这也侧面反应了. NET Core 的采用率也在直线上升.
来源: https://www.cnblogs.com/shanyou/p/10363360.html