Using Spring Cloud Gateway

There are three basic concepts around Spring Cloud Gateway:

  • Route: That is the basic building block of the gateway. It consists of a unique ID for identifying a route, a destination URI, a list of predicates, and a list of filters. A route is matched only if all the predicates have been fulfilled.
  • Predicates: These are the logic that is executed before processing each request. It is responsible for detecting whether the different attributes of the HTTP request, such as headers and parameters, match the defined criteria. The implementation is based on the Java 8 interface java.util.function.Predicate<T>. The input type is in turn based on Spring's org.springframework.web.server.ServerWebExchange.
  • Filters: They allow ...

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.