| With the development of the Internet,the service architecture is also facing more and more challenges.As the leader of the entire service architecture,the gateway is the entrance to directly handle client traffic.Its performance and reliability determine the stability of the entire business.In today’s complex Internet context,no gateway is a "silver bullet".Cloud providers and open source communities all have gateway related components and technologies,which are far from the stability and ease of use of production environments to deal with complex scenarios.To solve the above problems,this paper designs and implements a microservice gateway for high concurrency environment on the basis of the open source gateway framework.It addresses the challenges of high concurrency services through full link asynchronous non blocking transformation and traffic adaptive scheduling.At the same time,it responds to the demands of rapid business iteration in the Internet production environment through flexible changes and stability construction of the gateway.The main work of this paper is as follows:(1)By comparing the important features of several open source frameworks,and through performance pressure testing and comparison,Spring Cloud Gateway was selected as the underlying framework,and multiple supporting atomic capabilities were configured and developed on the application side,such as degraded current limiting,fuse technology,caching,rapid failure,monitoring statistics,and at the same time,by restructuring the full link communication mechanism,The asynchronous non blocking I/O model and back pressure rebound are used to improve the system throughput in high concurrency scenarios.(2)Build and define the interaction message of the configuration center,push it to the gateway to arrange and combine atomic capabilities through the responsibility chain loading mode,and use the interface definition of SPI to enable the gateway to have flexible customization and expansion capabilities.The redirect,forwarding and traffic marking of the request header are configured through the configuration center push,so that the gateway has the stability guarantee of grayscale publishing and multi live in different places.(3)Combined with the background of working in Internet e-commerce enterprises,the practice simulated the response strategy of the gateway in the scene of promoting seckill.The main innovation points of this paper are as follows:(1)This paper refers to the academic Actor computing model and implements asynchronous non blocking communication,which not only meets the demands of high concurrent throughput,but also saves hardware costs.(2)In this paper,atomic capabilities are customized and arranged through the configuration center,and real-time push takes effect,effectively addressing the flexible demands of actual business.(3)This paper designs and implements the overall service architecture with the ability to live in different places through gateway message forwarding,which effectively responds to the demand of the actual production environment for high availability of the system. |