当前位置:网站首页>Share an API Gateway project based on ABP and yarp
Share an API Gateway project based on ABP and yarp
2022-07-24 02:25:00 【Dotnet cross platform】
This project originated last year when the company tried to build a project with microservices , In the technical selection of gateway , We originally confirmed ApiSix gateway , If you need to write a gateway plug-in, you need to be based on Lua Script to write , Another colleague and I wrote a simple plug-in based on this , But development testing and release are troublesome , And use Lua Script as a plug-in development language itself is not our strength .
Later, I learned through other channels that Microsoft has produced a reverse proxy component Yarp, And some people have done some projects based on it , So I decided to build a simple one based on it Api gateway , It's good to be able to meet basic needs .
Project technology use :
Development platform :.Net 6 + MySql
Development framework :Abp Vnext 5.3.2
Reverse proxy component : Yarp ( Official documents :https://microsoft.github.io/reverse-proxy/index.html)
Background management :Blazor (Bootstrap Blazor UI: https://www.blazor.zone)
Other components : Dto mapping (Mapster)、 The logging component (Serilog)
Open source address (GitHub): https://github.com/yupingyong/kite.gateway
notes : This article will rarely show the code implementation itself
One . Project structure chart ( And layer dependency descriptions ):

Kite.Gateway.Admin : Back office management projects , Realize the management of gateway service node and gateway configuration data , Support to synchronously refresh configuration data like multiple nodes
Kite.Gateway.Hosting : Gateway startup project , Define the gateway filter and middleware
Kite.Gateway.Application : Application service layer , Combine business logic layer business , Submit the database to save
Kite.Gateway.Application.Contracts : Application service public contract layer , Define the application service layer interface ,DTO object
Kite.Gateway.Domain: Domain services , Business logic processing core layer
Kite.Gateway.Domain.Shared : Domain service sharing layer , Define public enumerations , General tools, etc
Kite.Gateway.EntityFrameworkCore : Storage implementation layer , Rely on Domain Services , be based on EF Core Realization
Two . Introduction to gateway execution process ( With pictures ):

Description of gateway middleware , The previous version was designed to utilize Abp Bring your own plug-in mechanism to realize , But in this edition, I have removed this design pattern . Why cancel the plug-in design pattern , I just feel that this gateway will lead to too deep correlation of specific businesses , In the new version, I use the gateway to initiate business services according to the configured middleware information Http Request or Grpc( Temporary unrealized ) The way to achieve , This reduces the dependence of the business on the gateway system , And the gateway's deep dependence on specific services .
3、 ... and . Background management introduction ( There will be more renderings ):

1. Account management : Account management of login background management ( If it is newly installed, it can be used admin/admin Log in )

2. Node management : Gateway deployment node , Background management can push configuration dynamic refresh to nodes , It can take effect in time

3. Service governance configuration : Consul Information configuration , At present, we support Consul As a service governance middleware

4. Authentication configuration : Jwt Verification configuration , Support custom keys and SSL Certificate is in progress token check

5. White list configuration : Gateway filters the white list , When the request address appears in the white list , It won't go on token check

6. Routing management : Yarp Reverse proxy component information configuration , Support the configuration of routing information 、 Cluster information 、 Health check information 、 Load balancing policy information

7. Middleware management : Configure middleware information

notes : More functions , You can run the actual test locally after downloading the source code .
边栏推荐
- WordPress website SEO complete tutorial
- View binding confusion. I have been studying confusion for two days.
- Redis 6.0 source code learning simple dynamic string
- ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
- One year after graduation, I gave up the internship opportunity and taught myself software testing at home. The internship of my classmates has just ended. I have become a 12K monthly salary testing e
- Loadrunner12 installation, recording the first script and the proxy server did not respond to the solution
- Login with a third-party account
- Leetcode 203. remove linked list elements (2022.07.22)
- 【补题日记】[2022杭电暑期多校1]B-Dragon slayer
- Qt开发串口通讯软件中的数据转换问题:读取时_QByteArray转string;发送时_数据格式;int转16进制格式string;string中截取字符;16进制数加法;string转ByteAr
猜你喜欢

Wallys/PD-60 802.3AT Input Output802.3AT/AT 85% Efficiency 10/100/1000M GE Surge Protection

Opensmile introduction and problems encountered during installation

Leetcode 70 climbing stairs, 199 right view of binary tree, 232 realizing queue with stack, 143 rearranging linked list

Preliminary use of 145 keep alive

Responsive pbootcms template decoration design website

程序员必备技能----断点调试(IDEA版)

Crud operation of mongodb (2)

Reconnaître le Protocole de couche de transport - TCP / UDP

Jina AI 联合Datawhale,发起学习项目!

STM32概念和安装【第一天】
随机推荐
毕业设计校园信息发布平台网站源码
Wenxin big model raises a new "sail", and the tide of industrial application has arrived
Leetcode exercise -- two questions about the nearest common ancestor of binary trees
【补题日记】[2022杭电暑期多校1]B-Dragon slayer
Resumption: a deck of cards (54), three people fighting the landlord, what is the probability that the big and small kings are in the same family
Research on XMPP service (I)
ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
Share two interesting special effects
[重要通知]星球线上培训第三期来袭!讲解如何在QTYX上构建自己的量化策略!...
Beansearcher receives array parameters and logical deletion
Live800:客户服务无小事,别让服务击溃企业口碑
Rylstim Screen Recorder
5年接触近百位老板,身为猎头的我,发现升职的秘密不过4个字
新红包封面平台可搭建分站独立后台的源码
STM32 installation tutorial and j-link burning driver installation tutorial [the next day]
認識傳輸層協議—TCP/UDP
Reconnaître le Protocole de couche de transport - TCP / UDP
响应式布局一个网页在不同设备显示不同效果)meta:vp
分享一个基于Abp 和Yarp 开发的API网关项目
STM32 concept and installation [day 1]