Fredrich Ombico

Fredrich Ombico

Alumni
Blog posts by Fredrich Ombico

Creating a custom Spring Cloud Gateway Filter

Engineering | August 26, 2022 | ...

In this article, we look into writing a custom extension for Spring Cloud Gateway. Before we get started, let’s go over how Spring Cloud Gateway works:

Spring Cloud Gateway diagram

  1. First, a client makes a network request to the Gateway
  2. The Gateway is defined with a number of routes, each with Predicates to match the request to the route. For example, you can match on the path segment of the URL or the HTTP method of the request.
  3. Once matched, the Gateway executes pre-request logic on each of the filters applied to the route. For example, you might want to add query parameters to your request
  4. A proxy filter routes the request to the proxied service
  5. The service executes and returns a response
  6. The gateway receives the response and executes post-request logic on each filter before returning the response. For example…

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all