Coder Social home page Coder Social logo

hsjalilian / ocelot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 209 KB

This repository contains simple samples demonstrating the use of Ocelot to build an API Gateway in .NET. Explore the provided examples to learn how to leverage Ocelot for routing and aggregation in your microservices architecture.

License: Apache License 2.0

C# 100.00%
api-gateway dotnet dotnet-core dotnetcore microservices-architecture middleware ocelot ocelot-api-gateway ocelot-gateway ocelotsample serilog swagger

ocelot's Introduction


Table of Contents
  1. Ocelot API Gateway
  2. What Is an API Gateway?
  3. What Is Ocelot
  4. Features
  5. How to install
  6. Roadmap
  7. Sample Projects

Ocelot API Gateway

This repository contains some samples that show ocelot features in different projects from basic to advance config.

What Is an API Gateway?

An API gateway is an API management tool that sits between a client and a collection of backend services.

An API gateway acts as a reverse proxy to accept all application programming interface (API) calls, aggregate the various services required to fulfill them, and return the appropriate result.

Benefits of API gateways

  • Security
  • API authentication
  • Input validation
  • Filtering
  • Faster response times
  • load balancing
  • Rate limiting
  • Expose only one endpoint
  • Billing for microservices
  • caching
  • Monitoring and tracking
  • Extending legacy apps

What Is Ocelot

Ocelot is a .NET API Gateway. This project is aimed at people using .NET running a micro services/service-oriented architecture that needs a unified point of entry into their system. However, it will work with anything that speaks HTTP and run on any platform that ASP.NET Core supports.

Features

For a quick list of Ocelot's capabilities for more information see the documentation.

  • Routing
  • Request Aggregation
  • Service Discovery with Consul & Eureka
  • Service Fabric
  • Kubernetes
  • WebSockets
  • Authentication
  • Authorization
  • Rate Limiting
  • Caching
  • Retry policies / QoS
  • Load Balancing
  • Logging / Tracing / Correlation
  • Headers / Method / Query String / Claims Transformation
  • Custom Middleware / Delegating Handlers
  • Configuration / Administration REST API
  • Platform / Cloud Agnostic

How to install

Ocelot is designed to work with ASP.NET and it targets net6.0.

Install Ocelot and it's dependencies using NuGet.

Install-Package Ocelot

Or via the .NET Core CLI:

dotnet add package ocelot

All versions can be found here

Sample Projects

Basic

The simplest sample that introduces how to use Ocelot here.

Link here : Basic

Multi Services

Same as the Basic template but routes requests to multi services.

Link here : Mulit Services

Request Aggregation

In this project, receive request and collect response from two different services.

Link here : Request Aggregation

Logging

In this project, use Serilog for log all request in file.

Link here : Logging

Authentication And Authorization

In this project, handle authentication and authorization with JWT Token.

Link here : Authentication And Authorization

RateLimit

In this project, handle client request limitation in custom periodic time per endpoint.

Link here : RateLimit

Caching

In this project, use CacheManager for caching output response.

Link here : Caching

Load Balance

In this project, Balance request to multi same service.

Link here : Load Balance

Swagger

In this project, Enable Swagger for APIs.

Link here : Swagger

Qos

In this project, Enable circuit breaker.

Link here : QoS

ocelot's People

Contributors

hsjalilian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.