Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

.NET API Gateway

License

NotificationsYou must be signed in to change notification settings

ThreeMammals/Ocelot

Repository files navigation

Ocelot Logo

Release StatusDevelopment StatusReadTheDocsCoverallsLicense: MITNuGetDownloads

About

Ocelot is a .NETAPI gateway.This project is aimed at people using .NET running a microservices (service-oriented) architecture that needs a unified point of entry into their system.However, it will work with anything that speaks HTTP(S) and runs on any platform thatASP.NET Core supports.

Ocelot consists of a series of ASP.NET Coremiddlewares arranged in a specific order.Ocelotcustom middlewares manipulate theHttpRequest object into a state specified by its configuration until it reaches a request builder middleware, where it creates aHttpRequestMessage 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 request goes back up the Ocelot pipeline.There is a piece of middleware that maps theHttpResponseMessage onto theHttpResponse object, and that is returned to the client.That is basically it, with a bunch of other features!

Install

Ocelot is designed to work withASP.NET Core and it targetsnet8.0LTS andnet9.0STS target framework monikers (TFMs).1

InstallOcelot package and its dependencies using NuGet package manager:

Install-Package Ocelot

Or via the .NET CLI:

dotnet add package Ocelot

All versions are availableon NuGet.

Documentation

  • RST-sources:This includes the source code for the documentation (in reStructuredText format, .rst files), which is up to date for the currentdevelopment.And the rendered HTML documentation is availablehere.
  • Read the Docs:This official website, in HTML format, contains a wealth of information and will be helpful if you want to understand thefeatures that Ocelot currently offers.The rendered HTML documentation, which is currently indevelopment, is availablehere.
  • Ask Ocelot Guru:It is an AI focused on Ocelot, designed to answer your questions.2

Features

The primary features—Configuration andRouting—are always utilized by users, even in a minimal app setup, without customizations or extra configurations.Ocelot's capabilities are categorized into three main groups of features:solid,hybrid, andfeature-family groups, which are explained below.

  • Solid features are unique to Ocelot. They do not contain subfeatures and are not related to other features.
  • Hybrid features, on the other hand, have multiple relationships with other features and can be part of other features.
  • Feature families are large groups that consist of multiple subfeatures.
GroupFeatures
PrimaryConfiguration,Routing
SolidCaching,Delegating Handlers,Quality of Service3,Rate Limiting
HybridAdministration,Aggregation4,Authentication,Configuration,Dependency Injection,Load Balancer
FamilyConfiguration,Routing,Logging,Transformations,Service Discovery5

Feature groups are explained in the table below →

FeatureRelationships and Notes
AdministrationAdministration heavily depends onAuthentication, andAdministration API methods are part ofAuthentication,Caching, andConfiguration
Aggregation4Aggregation relies onRouting
AuthenticationAuthentication followed byAuthorization
ConfigurationConfiguration depends onDependency Injection, includingGET/POST operations via theAdministration REST API, a specializedWebsockets scheme/protocol, advancedMiddleware Injection, andMetadata-based extensions
RoutingRouting includes a specializedWebsockets mode but does not supportGraphQL6
Load BalancerLoad Balancer is a critical dependency forService Discovery
LoggingLogging includesError Handling andTracing
Service Discovery5Service Discovery with the following discovery providers:Consul,Kubernetes,Eureka, andService Fabric
TransformationsThey provide transformations forClaims,Headers, andMethod

Ocelot customizations can be configured usingMetadata, developed withDelegating Handlers, and in advanced scenarios, they can be developed and then configured withMiddleware Injection.For further details, refer to theDocumentation.

Contributing

You can see what we are working on in thebacklog.We love to receive contributions from the community, so please keep them coming.Pull requests, issues, and commentary welcome!octocat

Please complete the relevanttemplate forissues andpull requests.Sometimes it's worth getting in touch with us todiscuss 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 thingsoctocat

Finally, we mark all existing issues aslabel: help wantedlabel: small effortlabel: medium effortlabel: large effort.7If you want to contribute for the first time, we suggest looking at alabel: help wantedlabel: small effortlabel: good first issueoctocat

Notes

Footnotes

  1. Starting with version21 and higher, the solution's code base supportsMultitargeting as SDK-style projects. It should be easier for teams to migrate to the currently supported.NET 8 and 9 frameworks. Also, new features will be available for all .NET SDKs that we support via multitargeting. Find out more here:Target frameworks in SDK-style projects

  2. Ocelot Guru is an unofficial tool to get answers regarding Ocelot: please consider it an advanced search tool. Thus, we have an officialQuestions & Answers category in theDiscussions space.

  3. Retry policies only viaPolly library referenced within theOcelot.Provider.Polly extension package.

  4. Previously, theAggregation feature was calledRequest Aggregation in versions23.4.3 and earlier. Internally, within the Ocelot team, this feature is referred to asMultiplexer.2

  5. Ocelot supports the following service discovery providers: (1)Consul through theOcelot.Provider.Consul extension package, (2)Kubernetes via theOcelot.Provider.Kubernetes extension package, and (3)Netflix Eureka, which utilizes theSteeltoe.Discovery.Eureka package referenced within theOcelot.Provider.Eureka extension package. Additionally, Ocelot supports (4) AzureService Fabric for service discovery, along with special modes such asDynamic Routing andCustom Providers.2

  6. Ocelot does not directly supportGraphQL. Developers can easily integrate theGraphQL for .NET library.

  7. See alllabels for the repository, which are useful for searching and filtering.


[8]ページ先頭

©2009-2025 Movatter.jp