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.