General enterprise structure diagram:
One: GateWay related introduction:
What is GetWay?
Before using ZUUL gateway, why use GateWay now?
----One: The non-Reactor mode is used in the zuul1.x version. Two: The zuul2.0 version has not yet been fully released, so I dare not adopt it; gateway is a brand new gateway technology developed by Spring itself.
The difference between the two:
Two: The three core concepts of gateWay: Route, Predicate, Filter
what? startup error...
The reason for the error is posted:
There are two configurations for GateWay gateway routing:
1. Configure in the configuration file yml: as shown below:
2. Inject the Bean of RouteLocator in the code: but this is not often used, and the commonly used configuration is in yml:
The routing in steps 1 and 2 above is directly written dead, which is obviously unreasonable. Dynamic routing should be implemented through the microservice name:
Implement dynamic routing yml:
13 Loaded RoutePredicateFactory: Assertions
Filter: 1- Common Filter GateWayFilter 2- Custom Filter
1. Common filters are configured in yml: only one is shown below, which can be queried by Baidu; but basically, common filters are not used, and custom filters are commonly used.
2. Custom filter: