Spring Cloud ZuultheNetflix Zuulthe encapsulation is implemented
new Spring boot project demo-springcloud-api-gateway, creating startup class Zuulapplication,@ Enablezuulproxy Start the configuration of the gateway agent, which is also a combination of annotations, enabling service registration discovery and fuses
Project-Critical dependency Spring-cloud-starter-zuul support for gateways
The configuration file application.properties, the routing configuration mainly has the traditional route and the service route, the traditional route is the IP and the port this, the service route is uses the service name as the route. Traditional routes we configured as /tradition/**, service routing configured for /servicetoclient and Servicetoconsumer
Start the registry, start the service provider, launch Demo-springcloud-api-gateway, browser access Http://localhost:4441/tradition/hello and http://localhost:4441 /servicetoclient/hello and Http://localhost:4441/serviceToConsumer/hello and http://localhost:4441/ Demo-springcloud-consumer/hello are normally accessed
Dry Goods sharing microservices Spring-cloud (6. API Gateway Service Zuul)