兵工自动化2025,Vol.44Issue(7):5-10,36,7.DOI:10.7690/bgzdh.2025.07.002
一种微服务架构的API网关设计
A Design of API Gateway Based on Microservice Architecture
林志达 1张华兵 2郭献彬 1曹小明2
作者信息
- 1. 中国南方电网有限责任公司,广州 510670
- 2. 南方电网数字电网研究院有限公司,广州 510670
- 折叠
摘要
Abstract
In order to solve the demand problem of background service invocation in the process of microservice construction and realize the efficient invocation of service interface,it is proposed to use the application programming interface(API)gateway to encapsulate the background service into API,and use the API gateway to open it to users for invocation.The functional and non-functional requirements of the API gateway are analyzed,and the specific specifications and requirements of each requirement are described.The request access module is implemented based on the Netty framework,and the idle connection is filtered by using the user activity,so as to improve the support capability for high-concurrency requests;Combining with the characteristics of different protocol calls,the adaptation ability of API gateway to different protocols is realized based on enterprise service bus,and the modular design of API gateway is carried out with function as the unit.The experimental results show that the use of user activity differentiation strategy can increase the maximum number of server connections,the response delay of the gateway is less than 13 ms,and the maximum transactions per second(TPS)is 3 450,which meets the requirements of performance requirement TPS 3 000 and delay 20 ms;A network interface object(NIO)model is introduced for comparison with API gateways.The results show that the designed API gateway meets the expected requirements and can be put into practical application,which can provide a reference for the study of efficient API gateway.关键词
微服务架构/API网关/企业服务总线/服务调用/Netty框架Key words
microservice architecture/API gateway/enterprise service bus/service invocation/Netty framework分类
信息技术与安全科学引用本文复制引用
林志达,张华兵,郭献彬,曹小明..一种微服务架构的API网关设计[J].兵工自动化,2025,44(7):5-10,36,7.