# concept

Routing defines how the gateway handles requests, and is divided into three types: reverse proxy, service discovery, and service orchestration.

#Configuration

The definition of routes can be completed through the gateway management background:

The following describes the configuration of reverse proxy and service discovery routing respectively. Assume that the gateway is deployed as 1.1.1.1:8600 and no group is specified, which is the default group.

# Reverse proxy routing

Reverse proxy: The gateway forwards the request directly to a deployment of the backend interface.

For example, the gateway proxy backend interface /a/b is required. The interfaces are deployed at 2.2.2.2:8080 and 3.3.3.3:9090. This can be accomplished by configuring the "reverse proxy" route:

The arrows above are configuration items and values:

Gateway Group: Select the default group.

Routing type: Select reverse proxy.

Backend server: The host and port of the exposed interface, starting with http://.

Front-end service name: virtual, expressing the service to which the interface belongs.

Front-end api path: The path for the client to access the back-end interface, which is a mapping relationship with the back-end api path.

Back-end api path: that is, the back-end interface path, /${1} refers to the entire front-end api path, that is, the front-end and front-end api paths are the same.

After the configuration is completed, the backend interface can be accessed through http://1.1.1.1:8600/proxy/aservice/a/b.

# Service discovery route

Service discovery: Based on the request information, the gateway obtains a deployment of the back-end interface from the service registration center and forwards the request to this deployment.

For example, if the aservice service registered at nacos: 6.6.6.6:8848 has interface /a/b and wants to be exposed to external calls through the gateway, the following configuration is required:

# Configure registration center

# Configure routing

Registration center: Select the newly added nacos center.

After the configuration is completed, the backend interface can be accessed through http://1.1.1.1:8600/proxy/aservice/a/b.

# Service orchestration routing

This will be introduced later in articles related to service orchestration.

# Introduction to FizzGate Integration Platform

FizzGate is a microservice aggregation gateway developed based on Java. It can achieve hot service orchestration and aggregation, automatic authorization selection, online service script coding, online testing, high-performance routing, API audit management, callback management, etc., and has powerful customization The plug-in system can be expanded by itself and provides a friendly graphical configuration interface, which can quickly help enterprises manage API services, reduce middle-layer glue codes, reduce coding investment, and improve the stability and security of API services.

Official website: https://www.fizzgate.com (opens new window)

GitHub: https://github.com/fizzgate/fizz-gateway-node (opens new window)

Code cloud: https://gitee.com/fizzgate/fizz-gateway (opens new window)

Getting Started Tutorial: https://www.fizzgate.com/fizz/guide/GettingStarted/ (opens new window)


Author: lancer