The article explains why browsers enforce same‑origin policies, then presents three practical ways to solve cross‑origin issues in a Spring Boot backend—using the @CrossOrigin annotation, routing through Spring Cloud Gateway, and making server‑side requests with HttpClient—accompanied by configuration examples and full code snippets.
This article explains why browsers enforce same‑origin policies, presents common CORS solutions such as the @CrossOrigin annotation, gateway integration with Spring Cloud Gateway, and using HttpClient, and provides detailed configuration and code examples for implementing these approaches in a Java backend project.
This article explains why browsers enforce same‑origin policies, presents common CORS solutions such as the @CrossOrigin annotation, HttpClient usage, and Spring Cloud Gateway integration, and provides detailed code examples for configuring gateways, CORS filters, and making HTTP requests in Java backend projects.
This article explores the shortcomings of current HTTP caching practices, proposes a three‑level cache design for B/S architectures, discusses gateway simplification with Apache APISIX, offers data‑size reduction tips, and presents a hand‑crafted Java HTTP cache framework with code examples.
This article explains the internal execution process of Spring Cloud Gateway, detailing how DispatcherHandler locates HandlerMapping, creates FilteringWebHandler, selects SimpleHandlerAdapter, builds and runs the filter chain—including core filters like RouteToRequestUrlFilter and NettyRoutingFilter—and transforms incoming URLs to their target destinations.
This article explains how to extend Sentinel's flow‑control capabilities in a Spring Cloud Gateway to implement traffic replication, covering Sentinel fundamentals, its slot‑chain architecture, custom filter code, configuration steps, and practical usage for testing and load‑testing with real traffic.
This article explains how to configure distributed rate limiting in Spring Cloud Gateway by adding the reactive Redis dependency, setting up Redis connection properties, defining a RequestRateLimiter filter with token‑bucket parameters, implementing a custom KeyResolver, and demonstrating the behavior with HTTP 429 and 403 responses.
This article explores the use of Reactor in Spring Cloud Gateway, highlighting its role in enabling reactive programming for efficient API gateway implementations through non-blocking, asynchronous operations and advanced data flow management.
This article explains why cross‑origin issues occur, presents common solutions such as @CrossOrigin, HttpClient and Spring Cloud Gateway, and provides detailed code examples for configuring CORS, building a gateway module, and making HTTP requests in a Java backend project.
This article provides a comprehensive overview of Spring Cloud Gateway's routing model, detailing the essential components of a route, the built‑in predicate factories, and the various gateway, default, and global filter implementations, helping developers avoid redundant work and reduce development costs.
After moving to a new team lacking a dedicated gateway, the author evaluates two popular microservice gateway solutions—Spring Cloud Gateway and Apache APISIX—comparing their features, cloud‑native capabilities, performance, and ease of use, ultimately selecting Spring Cloud Gateway for its Java ecosystem and extensibility.
This tutorial walks through setting up a Spring Cloud Gateway integrated with Nacos as a registration and configuration center, covering Nacos installation, project configuration, route definition, and a listener that dynamically refreshes service instances to ensure reliable request forwarding.
The article explains the specific stability, regulatory, and precision requirements of financial software, examines Java's role in the sector, describes the shortcomings of Spring Cloud Gateway, and details how Apache APISIX was adopted, deployed, customized, and evaluated to improve performance, cost, and operational efficiency in a cloud‑native environment.
This tutorial demonstrates how to set up a Spring Cloud Gateway service with static route configuration, then extend it to support dynamic routing through Nacos, and finally implement custom authentication and global filters using Java and Spring Boot.
This tutorial explains what gateway rate limiting is, shows how to integrate Alibaba Sentinel with Spring Cloud Gateway, details the configuration of Sentinel dashboard, gateway flow rules, API group management, implementation principles, and how to customize block responses for robust microservice protection.
This comprehensive guide explains why a service gateway is needed in microservice architectures, details Spring Cloud Gateway's core concepts, deployment steps, route and predicate configurations, local and global filters, integration with Nacos for service discovery, dynamic routing via Apollo, and custom global exception handling, providing code examples throughout.
This article explains how to design API gateways by comparing common gateway solutions, outlining essential design aspects such as routing, service discovery, load balancing, resilience, security, and high performance, availability, and scalability, and summarizing the strengths of OpenResty, Kong, Zuul, and Spring Cloud Gateway.
This guide walks through setting up a Spring Cloud Gateway service using Spring Boot 2.1, configuring static and dynamic routes via YAML and Nacos JSON, and implementing a custom authentication filter with Redis token validation, covering gateway framework, route definitions, dynamic updates, and security filters.
Monet is a custom API gateway built on Spring Cloud Gateway that consolidates multiple platform endpoints into a single domain, providing unified routing, API management via Zookeeper, authentication and authorization, dynamic rate‑limiting with Sentinel, and extensible monitoring, addressing scalability and operational challenges of the Linglong platform.
This article explains the fundamentals of API gateways, their role in microservice architectures, key design considerations such as routing, load balancing, security, and elasticity, and compares major open‑source implementations like OpenResty, Kong, Zuul, and Spring Cloud Gateway.
This article explains how to protect Spring Cloud Gateway APIs from data interception by using RSA asymmetric encryption, adding request timestamps and UUIDs for replay protection, and implementing request signatures, with detailed Java code examples and gateway filter configuration.
This guide explains how to protect a Spring Cloud Gateway service from packet sniffing by using RSA asymmetric encryption, timestamp validation, unique request IDs stored in Redis, and MD5 signature checks, with complete Java and front‑end code examples.
This article provides a comprehensive guide on securing Spring Cloud Gateway APIs using RSA asymmetric encryption, timestamp-based replay protection, unique request IDs stored in Redis, and MD5 signature verification, complete with detailed Java and front‑end code examples and testing results.
This article explains how to integrate Alibaba Sentinel with Spring Cloud Gateway to configure rate‑limiting and circuit‑breaker rules, covering Maven dependencies, Java configuration classes, Sentinel rule definitions, and optional console‑based management for robust backend API protection.
This article demonstrates how to integrate Alibaba Sentinel into Spring Cloud Gateway for traffic rate limiting and circuit breaking, covering Maven dependencies, configuration of SentinelGatewayFilter and exception handler, rule definitions via YAML or Java code, and custom API grouping, providing a complete backend gateway protection guide.
This article explains how to replace the deprecated Spring Security OAuth2 with a modern Spring Authorization Server solution, detailing the authentication flow, required components, configuration examples for Spring Cloud Gateway, Resource Server, and Id Server, and provides step‑by‑step demo instructions.
This article demonstrates how to set up a Spring Cloud Gateway service using SpringBoot 2.1, configure static routes, implement dynamic routing through Nacos configuration listening, and create a custom authentication GlobalFilter, providing a step‑by‑step guide with Maven dependencies, YAML/JSON examples, and full Java code.
This article explores two common microservice authentication and authorization architectures, compares a dedicated auth server versus gateway‑handled OAuth2 flows, and provides a step‑by‑step implementation using Spring Cloud Gateway, Spring Authorization Server, Spring Security, OpenID Connect, and token relay techniques to secure resources.
This article explains why Spring Cloud Gateway may return multiple Access-Control-Allow-Origin headers, analyzes the internal processing flow that causes the duplication, and provides two practical solutions—using DedupeResponseHeader configuration or a custom GlobalFilter—to ensure a single, correct CORS header in responses.
On March 1 2022 Spring released two critical CVEs (22946 and 22947) affecting Spring Cloud Gateway, detailing a remote code execution flaw via exposed Actuator endpoints and an insecure HTTP/2 TrustManager, and provides upgrade and configuration mitigation steps.
This article explains the two high‑severity Spring Cloud Gateway vulnerabilities disclosed on March 1, 2022, details their impact and affected versions, and provides concrete upgrade and configuration steps to mitigate the risks.
This article explains how to achieve gray (canary) release across multiple environments by using Spring Cloud LoadBalancer in Spring Cloud Gateway, configuring service metadata and request headers to route traffic to specific instances, and provides two implementation approaches with full code examples.
This article explains two high‑severity Spring Cloud Gateway vulnerabilities (CVE‑2022‑22946 and CVE‑2022‑22947), outlines the affected versions, describes how attackers can exploit exposed Actuator endpoints, and provides concrete mitigation steps such as upgrading to safe releases or disabling the gateway actuator.
This article explains why Spring Cloud Gateway may emit duplicate Access-Control-Allow-Origin and Vary headers during CORS handling, analyzes the internal processing flow, and provides two practical solutions—using DedupeResponseHeader configuration or a custom GlobalFilter—to eliminate the duplication.
This article explains two critical Spring Cloud Gateway vulnerabilities (CVE-2022-22946 and CVE-2022-22947), detailing their causes, affected versions, potential impact, and recommended remediation steps such as upgrading to safe releases or disabling the vulnerable actuator endpoint.
This article explains the remote code execution flaw in Spring Cloud Gateway's Actuator endpoint (CVE‑2022‑22947), lists the affected versions, and provides mitigation steps such as restricting endpoint exposure, upgrading to patched releases, and applying operational hardening best practices.
The article outlines two Spring Cloud Gateway CVEs—CVE-2022-22947 (critical code injection) and CVE-2022-22946 (medium HTTP/2 TrustManager issue)—detailing their severity, affected versions, and recommended mitigation steps such as upgrading to 3.1.1+, disabling Actuator, or securing it with Spring Security.
This tutorial explains how to quickly set up a Spring Cloud Gateway service, configure static and Nacos‑driven dynamic routes, and implement a Redis‑backed authentication filter that validates tokens, refreshes expiration, and forwards user information to downstream services.
Learn step‑by‑step how to set up a Spring Cloud Gateway service, configure static routes, enable dynamic routing using Nacos, and implement authentication filters with Redis, providing a complete guide for building a robust backend gateway in Java.
This tutorial demonstrates how to set up a Spring Cloud Gateway service using SpringBoot 2.1, configure static and dynamic routes with Nacos, implement a custom authentication filter, and manage route updates without restarting the gateway, providing a comprehensive guide for beginners.
This tutorial demonstrates how to set up a Spring Cloud Gateway using Spring Boot 2.1, configure static and Nacos‑driven dynamic routes, and create a custom authentication GlobalFilter that validates tokens against Redis, providing a complete guide for backend developers to implement secure, flexible routing.
This tutorial explains how to create a Spring Cloud Gateway service, configure static and dynamic routing using Nacos, and implement a custom authentication filter with Redis token validation, providing a step‑by‑step guide for backend developers building cloud‑native microservice gateways.
This article introduces Spring Cloud Gateway, outlines its core components such as routes, predicates, and filters, and provides a detailed step‑by‑step analysis of the request handling process—including code examples, filter chain execution, routing, and response writing—offering practical insights for backend developers.
This article demonstrates how to integrate Alibaba Sentinel into Spring Cloud Gateway to implement both route‑level and custom API‑level rate limiting, covering project setup, Maven dependencies, configuration files, custom block responses, and the importance of combining gateway and service‑side throttling for robust microservice protection.
This article explains why a gateway is essential in micro‑service architectures, introduces Spring Cloud Gateway’s core concepts such as routes, predicates and filters, shows step‑by‑step setup with Maven dependencies, demonstrates custom local and global filters, and details integration with Nacos for service discovery, load‑balancing, dynamic routing and global error handling.
This article explains how to apply rate limiting at each layer of a modern service architecture—SLB, Nginx, Spring Cloud Gateway, and individual microservices—detailing traffic characteristics, interception methods, isolation techniques, and practical configurations to protect systems from overload, attacks, and cascading failures.
This article provides a comprehensive overview of rate‑limiting techniques for Spring Cloud Gateway, covering common scenarios, classic algorithms such as fixed‑window, sliding‑window, leaky‑bucket and token‑bucket, and practical implementations using Redis, Resilience4j, Bucket4j, Guava and custom local limiters.
This article explores the evolution of Spring Cloud Gateway, explains common rate‑limiting scenarios and algorithms, reviews open‑source libraries such as Guava, Bucket4j and Resilience4j, and provides detailed guidance for implementing both local and distributed request‑frequency and concurrency limits within the gateway.
This article comprehensively explains rate‑limiting concepts for Spring Cloud Gateway, covering common throttling scenarios, major algorithms such as Fixed Window, Sliding Window, Leaky Bucket and Token Bucket, reviews popular open‑source libraries, and demonstrates both single‑node and distributed implementations with detailed code examples.
This article explores the evolution of Spring Cloud Gateway, explains common rate‑limiting scenarios and algorithms such as fixed‑window, sliding‑window, leaky‑bucket and token‑bucket, reviews open‑source limiters like Guava RateLimiter, Bucket4j and Resilience4j, and provides detailed guidance for implementing both single‑node and distributed rate‑limiting and concurrency‑limiting solutions within the gateway.
This guide demonstrates how to configure and test various Spring Cloud Gateway filter factories—including AddRequestHeader, AddRequestParameter, AddResponseHeader, PrefixPath, StripPrefix, Retry, RedirectTo, and default filters—using Spring Boot 2.3.7 with Hoxton.SR9, complete with YAML snippets and code examples.
This article explains the architecture, core concepts, routing mechanisms, configuration options, and extensibility of Spring Cloud Gateway, illustrating how it replaces Zuul with a non‑blocking Netty‑based solution and how to customize routes, predicates, filters, and dynamic updates for microservice environments.
This guide explains how to locate and customize route locators in Spring Cloud Gateway by examining ZuulServerAutoConfiguration and SimpleRouteLocator, then shows how to implement a custom route locator using Nacos as a configuration center, including code examples and necessary YAML settings.
This document outlines the technical, business, and product goals, functional requirements, architecture diagrams, technology selections, and detailed design and operational plans for building a highly available messaging center capable of handling 10,000 messages per second upstream and 1,000 messages per second downstream.
This guide explains how to combine Alibaba Sentinel with Spring Cloud Gateway, covering dependency setup, YAML configuration, startup parameters, and rule definition to achieve fine‑grained traffic control for microservice gateways.
This guide explains how to use Alibaba Sentinel with Spring Cloud Gateway, covering dependency setup, YAML configuration, gateway startup parameters, and defining flow‑control rules to protect microservice routes, including code examples and a brief summary of customization options.
This article explains the purpose and principles of API gateways in microservice architectures, introduces Spring Cloud Gateway's core concepts and workflow, and provides step‑by‑step examples for basic routing, weighted routing, rate limiting, and dynamic route management with complete code snippets.
This guide explains how to configure various Spring Cloud Gateway route predicates—including After, Before, Between, Cookie, Header, Host, Method, Path, and Query—providing YAML examples, execution flow, and test results to achieve precise request routing in a Spring Boot microservice environment.
This article demonstrates how to secure microservice communication by adding a request token in Spring Cloud Gateway, implementing a global filter to validate the token, and configuring a Feign interceptor to automatically attach the required header, ensuring all services route through the gateway.
This article details the background, selection, sidecar‑based deployment, custom features, performance testing, and production rollout of a Spring Cloud Gateway API gateway used to unify authentication, anti‑scraping, and routing logic across Node.js, Java, and PHP services in the 58 Anjuke second‑hand housing business line.
This tutorial explains how to build a Spring Cloud Gateway microservice gateway, covering CORS configuration, custom filters, token‑bucket rate limiting up to 100 000 QPS using Redis, and provides complete Maven, Java, and YAML code examples for deployment.
This article provides a comprehensive guide to Spring Cloud Gateway, covering its purpose, advantages, configuration steps, CORS handling, custom filters, token‑bucket rate limiting, and deployment instructions for building a robust microservice gateway in Java.
This article explains how Spring Cloud Gateway uses a token‑bucket algorithm backed by Redis and a Lua script to perform distributed rate limiting, reviews common limiting algorithms, provides detailed Java and Lua code examples, and analyzes each step of the implementation for high‑concurrency systems.
This article introduces Spring Cloud Gateway, explains its core concepts such as routes, predicates, and filters, demonstrates how to quickly set up a gateway with both Java‑based and configuration‑based routing, and shows how to create custom global and route‑specific filters for advanced request handling.
This article explains why traditional @ControllerAdvice fails in Spring Cloud Gateway, introduces the built‑in ExceptionHandlingWebHandler and DefaultErrorWebExceptionHandler, and shows how to override them with a custom GlobalExceptionConfiguration for robust reactive error handling.
This article explains why a Spring Cloud Gateway‑based microservice project encounters CORS‑related login failures, demonstrates how to reproduce the issue, and provides step‑by‑step configuration changes—including a global CORS filter and removal of duplicate filters—to resolve the problem.
Spring Cloud Gateway provides a powerful, reactive API gateway for Spring Boot applications, offering dynamic routing, predicates, and a variety of filters such as rate limiting, retries, and circuit breaking, with detailed examples of configuration via YAML and Java beans, integration with Eureka, and practical code snippets.
This article examines the limitations of Spring Cloud Gateway's native RequestRateLimiter, introduces Sentinel's flow control integration, provides Maven dependencies, configuration examples, and demonstrates dynamic rate‑limiting adjustments via Nacos, illustrating effective traffic protection for microservice gateways.
This article walks through creating a Spring Cloud Gateway‑based route service that logs incoming requests, demonstrates how to configure custom route predicates, add a logging filter, forward requests to a target URL, and finally deploy the service using Gradle.
A detailed benchmark comparing Spring Cloud Gateway, Zuul, and Linkerd shows that, contrary to popular belief, Spring Cloud Gateway delivers 1.6 times the throughput of Zuul and even outperforms Linkerd, after correcting earlier testing errors caused by a Reactor Netty bug.