一种微服务架构的API网关设计
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:


A Design of API Gateway Based on Microservice Architecture
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    为解决微服务构建过程中后台服务调用的需求问题,实现服务接口的高效调用,提出利用应用程序接口(application programming interface,API)网关将后台服务封装为API,利用API网关开放给用户调用。对API网关的功能性需求和非功能性需求进行分析,并描述每个需求的具体规格和要求;基于Netty框架实现请求接入模块,并利用用户活跃度对空闲连接进行过滤,提高对高并发请求的支持能力;结合不同协议调用的特点,基于企业服务总线实现API网关对不同协议的适配能力,以功能为单位对API网关进行模块化设计。实验结果显示:用户活跃区分策略的使用可以增加服务器的最大连接数;网关的响应时延在13 ms以内,极限事务数/秒(transactions per second,TPS)为3 450,满足性能需求TPS 3 000和时延20 ms的要求;引入一种网络接口对象(network interface object,NIO)模型与API网关进行对比。结果表明:设计的API网关满足预期要求,可投入实际应用,可为研究高效调用的API网关提供参考。

    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网关设计[J].,2025,44(07).

复制
分享
相关视频

文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2024-09-08
  • 最后修改日期:2024-10-09
  • 录用日期:
  • 在线发布日期: 2025-08-28
  • 出版日期:
文章二维码