CN110971472B - AWS style API secondary route forwarding method based on Kong - Google Patents
AWS style API secondary route forwarding method based on Kong Download PDFInfo
- Publication number
- CN110971472B CN110971472B CN201911404217.8A CN201911404217A CN110971472B CN 110971472 B CN110971472 B CN 110971472B CN 201911404217 A CN201911404217 A CN 201911404217A CN 110971472 B CN110971472 B CN 110971472B
- Authority
- CN
- China
- Prior art keywords
- kong
- route
- aws
- forwarding
- service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention particularly relates to an AWS style API secondary route forwarding method based on Kong. According to the AWS style API secondary route forwarding method based on the Kong, an Action parameter in a query is converted into a corresponding secondary route request by a Kong secondary route forwarding plug-in, and therefore primary forwarding to secondary routing is achieved. The method for forwarding the AWS style API secondary route based on the Kong solves the problem that the AWS style API cannot be forwarded through a gateway, only one primary route and an AWS secondary route forwarding plug-in are needed to be configured, the AWS style API with different Action parameter values can be forwarded to different real services through the combined Action of the route and the plug-in.
Description
Technical Field
The invention relates to the technical field of computer network API gateways, in particular to an AWS style API secondary route forwarding method based on Kong.
Background
An API (Application Programming Interface) is a predefined function, and an Application encapsulates its service capability into an API and opens the API to a user for calling through an API gateway.
An API Gateway (API Gateway, abbreviated as APIG) is one of the basic services in the microservice infrastructure. It not only provides basic routing function, forwards the request to the upstream service, but also can make authentication, authorization and current limiting operation, so as to protect the upstream service. In summary, all clients access microservices through API gateways, handling all non-business functions at the gateway level.
Kong is an open source API gateway, the lowest layer of which is based on Nginx and implemented on the scalable web platform openreserve on Nginx. By Kong, the common functions of all microservices can be centralized in one place, with each service focusing only on business related logic.
Kong supports the extension of functions through plug-ins, and also supports a customized third-party plug-in to realize customized functions while carrying a plurality of official common plug-ins, and adds the customized functions to upstream services. These plug-ins may support security authentication, flow control, logging, black and white listing, and certain translation functions.
The AWS BPM business process management development platform is business process management basic platform software which is easy to deploy and use, and provides full-period management from business process combing, modeling to operation, monitoring and optimization and role-oriented BPM Total Solution.
The AWS BPM provides a complete business process application modeling tool for quickly implementing new applications, and developers can quickly design and change user business models in a non-programming mode through the tool and package the models into own BPM solution through a model migration installation tool. The excellent technology of AWS BPM surpasses the solution provided by the traditional integration and business process management, and provides a multi-purpose platform software for enterprises, so that the core requirements of the enterprises on cooperation, process management and rapid construction of new applications can be met by using a single AWS product line.
The AWS style APIs need to be configured into Kong if they want to be exposed through the API gateway. However, the request parameters of the AWS style API are all in the query, and the Kong route is the request path of the API to be forwarded to different services as a unique identifier, so that the AWS style API cannot be successfully implemented.
Based on the situation, the invention provides an AWS style API secondary route forwarding method based on Kong.
Disclosure of Invention
In order to make up for the defects of the prior art, the invention provides a simple and efficient AWS style API secondary routing forwarding method based on Kong.
The invention is realized by the following technical scheme:
a kind of AWS style API second-level route forwarding method based on Kong, its characteristic lies in: and converting the Action parameter in the query into a corresponding secondary routing request by a Kong secondary routing forwarding plug-in, thereby realizing the primary forwarding to the secondary routing.
The Kong secondary routing forwarding plug-in converts the value of the Action parameter in the original request into a request, and converts the request path of the original AWS API into a character string formed by splicing a unique identification character string and an Action parameter value.
The invention relates to a Kong-based AWS style API secondary route forwarding method, which comprises the following steps:
step S101, an AWS style API with Action parameters is created;
step S102, configuring a primary route with a value of/and a service named localhost;
step S103, configuring a Kong second-level route forwarding plug-in and binding a first-level route;
step S104, configuring a secondary route and service;
step S105, request forwarding, namely, forwarding from the first level to the second level can be realized.
In step S101, the AWS style API sets a fixed parameter in the query as the real route of the API, where the fixed parameter is an Action parameter.
In step S102, the background configures a route and a service for Kong, where the path of the route is/, and the host parameter of the service matching with the path is localhost (local host); when the route with the/value is matched with the service of the localhost, which is equivalent to the Kong self, the real route (Action parameter) is entered at the moment, so that the purpose of secondary forwarding to the final upstream service can be achieved.
In step S103, the Kong secondary route forwarding plugin is bound with the primary route created in step S102; and the Kong secondary routing forwarding plug-in converts the Action parameter in the query into a character string which can be used as a unique identifier and spliced with the Action parameter value.
In step S104, a route and a service of the real request are configured, and a value of the route is a character string formed by splicing the character string which can be used as the unique identifier in step S103 and the Action parameter value; and then, configuring the real service (service), wherein the real service (service) is the address and path of the service to be actually requested.
In step S105, the http request passes through the Kong primary route/to the corresponding service (i.e. Kong local host), and the Kong secondary route forwarding plug-in will convert the value of the Action parameter in the http request into a request path, so as to enter the secondary route (/ the unique identification string/the value of the Action parameter), and then forward the request to the real service (service).
The invention has the beneficial effects that: the method for forwarding the AWS style API secondary route based on the Kong solves the problem that the AWS style API cannot be forwarded through a gateway, only one primary route and an AWS secondary route forwarding plug-in are needed to be configured, the AWS style API with different Action parameter values can be forwarded to different real services through the combined Action of the route and the plug-in.
Drawings
FIG. 1 is a schematic diagram of the AWS style API secondary route forwarding method based on Kong.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention more apparent, the present invention is described in detail below with reference to the embodiments. It should be noted that the specific embodiments described herein are only for explaining the present invention and are not used to limit the present invention.
According to the AWS style API secondary route forwarding method based on the Kong, an Action parameter in a query is converted into a corresponding secondary route request by a Kong secondary route forwarding plug-in, and therefore primary forwarding to secondary routing is achieved.
The core of the AWS style API secondary route forwarding method based on the Kong is based on a Kong secondary route forwarding plug-in. Kong is an open source API gateway that can implement authentication, security authentication, flow control, logging, black and white lists and some translation functions. Meanwhile, kong supports the extension of the functions of the plug-in, and supports a third-party plug-in to realize the customization function while the official plug-in provides the functions of basic logs, black and white lists and the like.
And the Kong secondary routing forwarding plug-in converts the value of the Action parameter in the request into a request and converts the request path of the original AWS API into a unique identification character string and an Action parameter value.
The AWS style API secondary route forwarding method based on the Kong comprises the following steps:
step S101, an AWS style API with Action parameters is created;
step S102, configuring a first-level route with a value of/and a service named localhost;
step S103, configuring a Kong second-level route forwarding plug-in and binding a first-level route;
step S104, configuring a secondary route and service;
step S105, request forwarding, namely, forwarding from the first level to the second level can be realized.
In step S101, the API in the AWS style sets a fixed parameter in the query as the real route of the API, where the fixed parameter is an Action parameter.
In step S102, the background configures a route and a service for Kong, where the path of the route is/, and the host parameter of the service matching with the path is localhost (local host); when the route with the value/is matched with the service of the localhost, which is equivalent to the Kong self request, the real route (Action parameter) is entered at the moment, so that the purpose of secondary forwarding to the last upstream service can be achieved.
In step S103, the Kong second-level route forwarding plugin is bound with the first-level route created in step S102; and the Kong secondary routing forwarding plug-in converts the Action parameter in the query into a character string which can be used as a unique identifier and spliced with the Action parameter value.
In step S104, a route and a service of the real request are configured, and a value of the route is a character string formed by splicing the character string which can be used as the unique identifier in step S103 and the Action parameter value; and then, configuring the real service (service), wherein the real service (service) is the address and path of the service to be actually requested.
In step S105, the http request passes through the Kong primary route/to the corresponding service (i.e. Kong local host), and the Kong secondary route forwarding plug-in will convert the value of the Action parameter in the http request into a request path, so as to enter the secondary route (/ the unique identification string/the value of the Action parameter), and then forward the request to the real service (service).
Compared with the prior art, the AWS style API secondary route forwarding method based on the Kong has the following characteristics:
firstly, the operation is simple and convenient, and only one primary route and an AWS secondary route forwarding plug-in are required to be configured once and for all;
secondly, the AWS style API with different Action parameter values can be forwarded to different real services through the combined Action of the router and the Kong secondary router forwarding plug-in, and the problem that the AWS style API cannot be forwarded through a gateway is fundamentally solved.
The above-described embodiment is only one specific embodiment of the present invention, and general changes and substitutions by those skilled in the art within the technical scope of the present invention are included in the protection scope of the present invention.
Claims (5)
1. A kind of AWS style API secondary route forwarding method based on Kong, characterized by that: converting the Action parameter in the query into a corresponding secondary routing request by a Kong secondary routing forwarding plug-in, thereby realizing the forwarding of the primary routing to the secondary routing;
the method comprises the following steps:
step S101, an AWS style API with Action parameters is created;
step S102, configuring a first-level route with a value of/and a service with a name of localhost;
step S103, configuring a Kong second-level route forwarding plug-in and binding a first-level route;
binding the Kong secondary route forwarding plug-in with the created primary route in the step S102, and converting the Action parameter in the query into a character string formed by splicing the unique identification character string and the Action parameter value by the Kong secondary route forwarding plug-in;
step S104, configuring a secondary route and a service;
step S105, request forwarding, namely, primary forwarding to secondary routing can be realized.
2. The Kong-based AWS style API secondary route forwarding method of claim 1, wherein: in step S101, the AWS style API sets a fixed parameter in the query as the real route of the API, where the fixed parameter is an Action parameter.
3. The Kong-based AWS style API secondary route forwarding method of claim 1, wherein: in step S102, the background configures a primary route and a service for Kong, where the path of the route is/, and the host parameter of the service matched with the path is localhost; when the primary route with the value/is matched with the service of localhost, which is equivalent to the request of the Kong, the real route is re-entered at the moment, so that the purpose of forwarding the secondary route to the last upstream service is achieved.
4. The Kong-based AWS style API secondary route forwarding method of claim 1, wherein: in the step S104, configuring a secondary route and service of the AWS style API, wherein the value of the secondary route is a character string formed by splicing the unique identification character string and the Action parameter value in the step S103; and then, configuring the real service, wherein the real service is the address and the path of the service to be actually requested.
5. The Kong-based AWS style API secondary route forwarding method of claim 1, wherein: in step S105, the http request passes through the Kong primary route/to the corresponding service, that is, the Kong local route, and the Kong secondary route forwarding plug-in converts the Action parameter value in the http request into a value of the secondary route, so as to enter the secondary route, and then forward the value to the real service.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911404217.8A CN110971472B (en) | 2019-12-31 | 2019-12-31 | AWS style API secondary route forwarding method based on Kong |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911404217.8A CN110971472B (en) | 2019-12-31 | 2019-12-31 | AWS style API secondary route forwarding method based on Kong |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110971472A CN110971472A (en) | 2020-04-07 |
CN110971472B true CN110971472B (en) | 2022-10-11 |
Family
ID=70037539
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911404217.8A Active CN110971472B (en) | 2019-12-31 | 2019-12-31 | AWS style API secondary route forwarding method based on Kong |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110971472B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114143261B (en) * | 2021-12-01 | 2023-06-27 | 浪潮云信息技术股份公司 | Method and system for dynamically routing back-end address by API gateway |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109710223A (en) * | 2018-12-29 | 2019-05-03 | 北京邮电大学 | API gateway hot plug system based on distributed KV storage system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170272547A1 (en) * | 2016-03-18 | 2017-09-21 | Interactive Intelligence Group, Inc. | System and method for configuration and interchanging of business functionality implementations |
CN109639572B (en) * | 2018-12-06 | 2021-01-26 | 网易(杭州)网络有限公司 | Route management method and device and micro-service system |
-
2019
- 2019-12-31 CN CN201911404217.8A patent/CN110971472B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109710223A (en) * | 2018-12-29 | 2019-05-03 | 北京邮电大学 | API gateway hot plug system based on distributed KV storage system |
Also Published As
Publication number | Publication date |
---|---|
CN110971472A (en) | 2020-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10439959B2 (en) | Service provisioning in a communication network | |
CN109088820B (en) | Cross-device link aggregation method and device, computing device and storage medium | |
WO2010130165A1 (en) | Method and system for generating open telecommunication service based on internet | |
JP5111256B2 (en) | Communication system and server device | |
CN104184774A (en) | Information processing method based on sandbox environment and system thereof | |
CN101729491A (en) | Method, device and system for enhancing application reliability of script-based business | |
CN106487538B (en) | Service acceleration method, strategy control platform and system | |
CN100499473C (en) | Method for realizing business request and on-line instruction system | |
CN102299834A (en) | Data sharing method, equipment and system for local area network | |
Nonde et al. | Virtual network embedding employing renewable energy sources | |
CN110971472B (en) | AWS style API secondary route forwarding method based on Kong | |
CN113556359A (en) | Communication protocol conversion method, device, system and gateway device | |
CN111010417A (en) | Data format conversion method, response system and method based on kong | |
CN114640957A (en) | Short message sending method, system, equipment and computer readable storage medium | |
WO2011124082A1 (en) | Service management system and method | |
WO2021082860A1 (en) | Configuration method, and related apparatus and system | |
CN114416314B (en) | Service arrangement method based on API gateway | |
Huang et al. | Automated service composition and routing in networks with data-path services | |
CN104717316A (en) | Client access method and system in trans-NAT environment | |
JP2017220240A (en) | Graphical policy interface for network control system | |
JP4967056B2 (en) | Policy determination apparatus, method, and program | |
CN112702203A (en) | Nginx cluster white screen configuration management method and system | |
CN116112580B (en) | Hardware pipeline GTP data distribution method and device for power low-delay service | |
JP4967055B2 (en) | Information processing system, method and program | |
WO2022017254A1 (en) | Method and apparatus for generating service template, and device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park Applicant after: Inspur cloud Information Technology Co.,Ltd. Address before: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park Applicant before: Tidal Cloud Information Technology Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |