A brief introduction of micro-services gateway Zuul

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_41948075/article/details/97523069

The following describes from ☞ Detailed Spring Cloud Zuul service gateway and use Zuul build API Gateway
Benpian not too in-depth introduction. Features / performance test engineers need to know gateway services can be developed, then you need to understand.

I. Background and Introduction to Micro Services Gateway

Different micro-services in general have different network addresses, and external clients may need to call multiple service interfaces to complete a business needs. For example, a movie ticket collection APP, micro film classification may call back services, users micro-service, micro-payment services. If the client and micro service to communicate directly, there will be the following questions:

  1. The client repeatedly requested different micro-services, increase the complexity of the client
  2. Cross-domain request processing at a certain scene is relatively complex
  3. Certification complex, each service requires a separate certification
  4. Difficult to reconstruct, with the iteration of the project may need to be re-divided micro service, if the client directly and micro-service communication, then the reconstruction will be difficult to implement
  5. Some micro services may use other protocols, direct access will be difficult

The above-mentioned problems can be solved by means of micro-service network management. Micro-services network is interposed an intermediate layer between the client and the server, all requests will go through the external micro serving gateway architecture evolved to:
Here Insert Picture Description

Two, Zuul Profile

Zuul is open source Netflix micro-services gateway,Zuul Netflix is ​​produced based on a JVM routing and server load balancer. It can Eureka, Ribbon, Hystrix use with other components. Zuul core component is a series of filters, these filters can perform the following functions:

  1. Authentication and security: identification verification requirements for each resource, and reject those that do not match the request
  2. Review and Monitoring:
  3. Dynamic Routing: dynamic route requests to different backend cluster
  4. Stress Test: gradually increase traffic to the cluster to understand the performance
  5. Load distribution: corresponding to the load capacity for each type of distribution, and discards the request exceeds the limit value
  6. Static response processing: edge position to respond, to avoid forwarded to the cluster.
  7. Multi-regional flexibility: Cross-domain routing request AWS Region designed to achieve ELB (ElasticLoad Balancing) use diversification

Third, what is the gateway? Why do I need to use Gateway?

Here Insert Picture Description
By drawing on the services provided externally, in the absence of gateway situation, API service interfaces directly exposed to the caller , the caller increased when, callers of different services vary, it is bound to add customized access privileges such as checking logic . When adding API Gateway, and then a third-party call between the terminal and the service provider to create a wall, this wall permissions control directly communicate with the caller, after requesting a balanced distribution to end back-office services, as without direct access to compute -service add method, but by api-a / add link passes the request to the service instance .Zuul is to provide load balancing - reverse proxy - certification authority of such an API gateway.
Nginx is similar to adding a wall of protection wall in the forefront of application services, zuul load balancing is for dispatches requests to a service station or a service instance in the cluster. The ribbon is also the main service load function, it is a service for consumers to call to request a specific distribution service provided examples. Both do load balancing, actually is on a different system levels.

Well, here briefly over ~

Guess you like

Origin blog.csdn.net/weixin_41948075/article/details/97523069