In the micro-service architecture, several basic micro-services are required, including service registration and discovery, service consumption, load balancing, circuit breakers, I-can routing, configuration management, and so on, by these several basic components to work together to build a simple micro-service system.
-zuul Introduction
Zuul is Netflix's open source MicroServices gateway, which he can use with components such as Eureka,ribbon,hystrix. The core of the Zuul component is a series of filters that can perform the following functions:
1, identity authentication and security: Identify the authentication requirements for each resource and reject those that do not match
2, review and monitoring:
3, dynamic routing: Dynamically routing requests to different back-end clusters
4, Load distribution: Allocate the corresponding capacity for each type of load and discard requests exceeding the qualified value
5, static response processing: The edge position responds to avoid forwarding to the internal cluster
6 Multi-Zone resiliency: Request routing across domain AWS region for ELB (elasticload balancing) Use diversification
Spring Cloud consolidates and enhances the Zuul. Currently, Zuul uses the Apache HTTP Client as the default.
Zuul and Eureka are used together, Zuul need to register to Eureka,
Pom files need to add dependencies:
<Dependencies> <Dependency> <groupId>Org.springframework.cloud</groupId> <Artifactid>Spring-cloud-starter-netflix-eureka-client</Artifactid> </Dependency> <Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-web</Artifactid> </Dependency> <Dependency> <groupId>Org.springframework.cloud</groupId> <Artifactid>Spring-cloud-starter-netflix-zuul</Artifactid> </Dependency> </Dependencies>
In its entrance Applicaton class plus annotation @enablezuulproxy, it is added by default @enablecircuitbreaker and @enablediscoveryclient, So we just need to add annotated annotations @enablezuulproxy
Springcloud Learning--routing gateways