SpringCloud -- zuul

What is the API Gateway

In the micro-service architecture, usually have multiple service providers. Imagine a power system provider, there may be a commodity, orders, payments, and other types of services users, while the number of each type of service will increase as the body mass of the entire system will grow and change. As the end of the UI you may need to aggregate data from a plurality of micro page while displaying services, and service structure dividing position may change. Gateway can begin to expose small changes in polymerization API, shielding internal micro services, maintain the stability of the entire system. Of course, this is just some of the many features in the gateway, it can do load balancing, unified authentication, protocol conversion, and a series of surveillance monitoring functions.

What is Zuul

Zuul is micro-services API gateway Spring Cloud family bucket.

All coming from the device or site requests will go through Zuul reaches the rear end of the Netflix application. As a border nature of the application, Zuul provides dynamic routing, monitoring, and security features elastic load. Zuul filter using a variety of underlying achieve the following functions:

  • Authentication and security authentication is required to identify each resource, deny the request does not meet the requirements.
  • Performance monitoring and statistics tracking service boundary data to provide an accurate view of production.
  • Dynamic routing as required dynamic routing request to the backend cluster.
  • Gradually increase the flow of stress tests on the cluster to understand their performance.
  • Offload advance for each type of capacity allocation request, automatically discarded when the request exceeds capacity.
  • Static resources to deal with some of the responses directly back at the border

 

  •  Before request routing is called pre Filter 
  • Construction of a request sent to the micro-service routing filters
  • post filter (add response headers to collect statistics and indicators) after the request is called the road
  • Executing error filter error filters occur at other stages of the request
  • Custom filter custom filters

Guess you like

Origin www.cnblogs.com/huyande/p/12502809.html