.net core 必學開源項目一

網關(Gateway)又稱網間連接器、協議轉換器。網關在網路層以上實現網路互連,是最複雜的網路互連設備,僅用於兩個高層協議不同的網路互連。網關既可以用於廣域網互連,也可以用於區域網互連。 網關是一種充當轉換重任的計算機系統或設備。使用在不同的通信協議、數據格式或語言,甚至體系結構完全不同的兩種系統之間,網關是一個翻譯器。與網橋只是簡單地傳達信息不同,網關對收到的信息要重新打包,以適應目的系統的需求。同層--應用層。

示意圖

相關搜索

從圖中我們不難看出,推舉度最高的裡面有一個比較完善的,它叫Ocelot。

Ocelot is a .NET Api Gateway. This project is aimed at people using .NET running a micro services / service orientated architecture that need a unified point of entry into their system.

Advertisements

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 stored in a per request scoped repository and 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.

Advertisements

項目地址:https://github.com/TomPallister/Ocelot

項目文檔:http://ocelot.readthedocs.io/en/latest

再次提醒各位同學,點關注不迷路哦!

Advertisements

你可能會喜歡