The core is loaded, the routing function is as follows
After obtaining routing route, then call validateRoute check
Create a type of org.springframework.cloud.gateway.config.GatewayProperties
Bean object, used to load the configuration file RouteDefinition configuration / FilterDefinition
Look at the routing example sample, as follows
Specify a filter, it is forwarded to the designated post-processing uri
Route construction, divided into synchronous and asynchronous, the parameters are RouteDefinition
Look load RouteDefinition
RouteDefinition, text string initialized by
Similarly initialization PredicateDefinition
Similarly FilterDefinition
Reads the routing configuration from the configuration file
routes
Property, routing configuration. By spring.cloud.gateway.routes
Configuration
Route memory
That is to update the local data memory map of routes
DiscoveryClientRouteDefinitionLocator route discovery, obtaining registration in the registry list of services, generating a corresponding array RouteDefinition.
1. First analytical expression profiles, get includePredicate
The parsed service instance and urlExpr serviceInstance, constructed routeDefinition
3. then parsed profile predicate, is added to the RouteDefinition
4. Continue parses out the configuration file filters, added to the RouteDefinition
5. Finally return RouteDefinition