Ocelot 23.4.2
dotnet add package Ocelot --version 23.4.2
NuGet\Install-Package Ocelot -Version 23.4.2
<PackageReference Include="Ocelot" Version="23.4.2" />
paket add Ocelot --version 23.4.2
#r "nuget: Ocelot, 23.4.2"
// Install Ocelot as a Cake Addin #addin nuget:?package=Ocelot&version=23.4.2 // Install Ocelot as a Cake Tool #tool nuget:?package=Ocelot&version=23.4.2
About
Ocelot is a .NET API Gateway. This project is aimed at people using .NET running a microservices / service-oriented architecture that need a unified point of entry into their system. However it will work with anything that speaks HTTP(S) and run on any platform that ASP.NET Core supports.
In particular we want easy integration with IdentityServer reference and Bearer tokens. We have been unable to find this in our current workplace without having to write our own Javascript middlewares to handle the IdentityServer reference tokens. We would rather use the IdentityServer code that already exists to do this.
Ocelot is a bunch of middlewares in a specific order.
Ocelot manipulates the HttpRequest
object into a state specified by its configuration until it reaches a request builder middleware, where it creates a HttpRequestMessage
object which is used to make a request to a downstream service.
The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware.
The response from the downstream service is retrieved as the requests goes back up the Ocelot pipeline.
There is a piece of middleware that maps the HttpResponseMessage
onto the HttpResponse
object and that is returned to the client.
That is basically it with a bunch of other features!
Features
A quick list of Ocelot's capabilities, for more information see the Documentation.
- Routing
- Request Aggregation
- GraphQL [^1]
- Service Discovery [^2]
- Service Fabric
- Kubernetes
- Websockets
- Authentication
- Authorization
- Rate Limiting
- Caching
- Quality of Service [^3]
- Load Balancer
- Logging / Tracing / Correlation
- Headers / Method / Query String / Claims Transformation
- Custom Middleware / Delegating Handlers
- Configuration / Administration REST API
- Platform & Cloud Agnostic Building
Install
Ocelot is designed to work with ASP.NET Core and it targets net6.0
, net7.0
and net8.0
frameworks. [^4]
Install Ocelot package and its dependencies using NuGet Package Manager:
Install-Package Ocelot
Or via the .NET CLI:
dotnet add package Ocelot
All versions can be found on nuget.
Documentation
- Ocelot documentation — Read the Docs <br/>This includes lots of information and will be helpful if you want to understand the features Ocelot currently offers.
- Ocelot RST Docs <br/>This includes source code of documentation as .rst files which are up to date for current development.
Coming up
You can see what we are working on in backlog.
Contributing
We love to receive contributions from the community, so please keep them coming 😮ctocat: <br/>Pull requests, issues and commentary welcome!
Please complete the relevant template for issues and PRs. Sometimes it's worth getting in touch with us to discuss changes before doing any work in case this is something we are already doing or it might not make sense. We can also give advice on the easiest way to do things 😮ctocat:
Finally, we mark all existing issues as . [^5] <br/>If you want to contribute for the first time, we suggest looking at a 😮ctocat:
Notes
[^1]: Ocelot doesn’t directly support GraphQL. Developers can easily integrate the GraphQL for .NET library. [^2]: Ocelot does support Consul, Netflix Eureka, Service Fabric service discovery providers, and special modes like Dynamic Routing and Custom Providers. [^3]: Retry policies only via Polly library. [^4]: Starting with v21.0, the solution's code base supports Multitargeting as SDK-style projects. It should be easier for teams to move between (migrate to) .NET 6, 7 and 8 frameworks. Also, new features will be available for all .NET SDKs which we support via multitargeting. Find out more here: Target frameworks in SDK-style projects [^5]: See all labels of the repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- FluentValidation (>= 11.11.0)
- IPAddressRange (>= 6.1.0)
- Microsoft.AspNetCore.MiddlewareAnalysis (>= 6.0.36)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 6.0.36)
- Microsoft.Extensions.DiagnosticAdapter (>= 3.1.32)
-
net7.0
- FluentValidation (>= 11.11.0)
- IPAddressRange (>= 6.1.0)
- Microsoft.AspNetCore.MiddlewareAnalysis (>= 7.0.20)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 7.0.20)
- Microsoft.Extensions.DiagnosticAdapter (>= 3.1.32)
-
net8.0
- FluentValidation (>= 11.11.0)
- IPAddressRange (>= 6.1.0)
- Microsoft.AspNetCore.MiddlewareAnalysis (>= 8.0.11)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 8.0.11)
- Microsoft.Extensions.DiagnosticAdapter (>= 3.1.32)
NuGet packages (121)
Showing the top 5 NuGet packages that depend on Ocelot:
Package | Downloads |
---|---|
MMLib.SwaggerForOcelot
Swagger generator for Ocelot downstream services. |
|
Ocelot.Provider.Polly
Provides Ocelot extensions to use Polly.NET |
|
Ocelot.Cache.CacheManager
Provides Ocelot extensions to use CacheManager.Net |
|
Ocelot.Provider.Consul
Provides Ocelot extensions to use Consul |
|
2AxisTechnology.Core.CL
Plz don't install. |
GitHub repositories (33)
Showing the top 5 popular GitHub repositories that depend on Ocelot:
Repository | Stars |
---|---|
anjoy8/Blog.Core
💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
|
|
phongnguyend/Practical.CleanArchitecture
Full-stack .Net 8 Clean Architecture (Microservices, Modular Monolith, Monolith), Blazor, Angular 18, React 18, Vue 3, BFF with YARP, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, OpenID Connect, Entity Framework Core, OpenTelemetry, SignalR, Hosted Services, Health Checks, Rate Limiting, Cloud Services (Azure, AWS, GCP).
|
|
geffzhang/NanoFabric
基于Consul + .NET Core + Polly + Ocelot + Exceptionless + IdentityServer等开源项目的微服务开发框架
|
|
abpframework/abp-samples
Sample solutions built with the ABP Framework
|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
Version | Downloads | Last updated | |
---|---|---|---|
23.4.2 | 9,153 | 11/27/2024 | |
23.4.1 | 4,528 | 11/22/2024 | |
23.4.0 | 5,860 | 11/18/2024 | |
23.3.6 | 21,474 | 10/31/2024 | |
23.3.4 | 51,928 | 10/3/2024 | |
23.3.3 | 220,308 | 6/11/2024 | |
23.3.0 | 10,208 | 6/8/2024 | |
23.2.2 | 178,765 | 4/5/2024 | |
23.2.0 | 9,594 | 4/1/2024 | |
23.1.0 | 147,554 | 3/4/2024 | |
23.0.0 | 80,469 | 2/13/2024 | |
22.0.1 | 232,796 | 12/8/2023 | |
22.0.0 | 39,572 | 11/28/2023 | |
21.0.0 | 26,064 | 11/21/2023 | |
20.0.0 | 140,560 | 10/7/2023 | |
19.0.4 | 13,077 | 10/6/2023 | |
19.0.3 | 26,145 | 9/21/2023 | |
19.0.2 | 224,158 | 4/22/2023 | |
19.0.1 | 4,340 | 4/22/2023 | |
19.0.0 | 3,830 | 4/22/2023 | |
18.0.0 | 2,256,907 | 1/20/2022 | |
17.0.1 | 224,926 | 12/20/2021 | |
17.0.0 | 1,231,509 | 12/11/2020 | |
16.0.2 | 18,600 | 12/11/2020 | |
16.0.1 | 1,274,576 | 5/25/2020 | |
16.0.0 | 54,880 | 5/23/2020 | |
1.1.0 | 3,322 | 2/2/2017 |