本文へ移動
cccskills
無料GitHub で公開

spring-cloud-gateway

Use when building Spring Cloud Gateway 5 on Spring Boot 4, including WebFlux or Web MVC routes, edge authentication, trusted headers, rate limits, timeouts, and resilience. Do not use for ordinary outbound HTTP clients or domain orchestration.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md4.2 KB
  • agents/openai.yaml204 B
  • examples/bad-routes.yml281 B
  • examples/good-routes.yml374 B
  • examples/good-webmvc-routes.yml284 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Spring Cloud Gateway 5

Keep the gateway an edge adapter. Do not move domain workflows into filters.

Compatibility and dependencies

  • Use the latest Spring Cloud 2025.1.x release train for Spring Boot 4.
  • Boot 4.1 support starts with Spring Cloud 2025.1.2.
  • Import spring-cloud-dependencies as a BOM and omit versions from individual Cloud dependencies.
  • Choose exactly one gateway runtime.
<!-- Reactive Netty gateway -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-gateway-server-webflux</artifactId>
</dependency>

<!-- OR servlet gateway: spring-cloud-starter-gateway-server-webmvc -->

Do not use the old spring-cloud-starter-gateway coordinate or force a Boot 3 release train onto Boot 4. WebFlux requires Reactor Netty and cannot run as a traditional servlet WAR; Web MVC uses a servlet runtime and WebMvc.fn.

Gateway 5 configuration namespaces

Gateway 5 separates server implementations in configuration:

  • WebFlux: spring.cloud.gateway.server.webflux.*
  • Web MVC: spring.cloud.gateway.server.webmvc.*
spring:
  cloud:
    gateway:
      server:
        webflux:
          httpclient:
            connect-timeout: 2000
            response-timeout: 5s
          routes:
            - id: orders-api
              uri: http://orders.internal
              predicates:
                - Path=/api/orders/**
              filters:
                - RemoveRequestHeader=X-User-Id

The Boot 3-era spring.cloud.gateway.routes and spring.cloud.gateway.httpclient paths do not bind to Gateway 5's WebFlux server properties.

Route and security rules

  • Use stable route IDs and explicit predicates.
  • Remove client-provided forwarding, identity, and internal headers before creating trusted values.
  • Keep path and host rewriting visible and covered by tests.
  • Authenticate at the edge and authorize again in downstream services.
  • Relay tokens only to services with the intended audience.
  • Rate-limit by authenticated identity or a verified API key, not an untrusted address header.
  • Set global connection and response timeouts with narrow route overrides.
  • Retry only proven idempotent operations and only before response commitment.
  • Keep fallbacks bounded and expose sustained upstream failure.

Testing and operations

  • Test predicates, filters, trusted headers, CORS, timeouts, body limits, and status mapping.
  • Use a controlled upstream server rather than mocking gateway internals.
  • Record route ID, outcome, latency, and upstream failure with bounded metric tags.
  • Test each selected runtime with its matching Spring Cloud Gateway test support.

Examples

  • examples/good-routes.yml shows Gateway 5 WebFlux configuration.
  • examples/good-webmvc-routes.yml shows Gateway 5 Web MVC configuration.
  • examples/bad-routes.yml preserves the stale configuration as a warning.

Official sources

Gotchas

  • Agent uses spring.cloud.gateway.routes on Gateway 5 - use the server-specific namespace.
  • Agent uses spring-cloud-starter-gateway on Boot 4 - select the WebFlux or Web MVC server starter.
  • Agent selects a Cloud train without checking the exact Boot line - use the compatibility matrix.
  • Agent trusts a public identity header - derive identity after authentication.
  • Agent retries POST requests automatically - retry only proven idempotent operations.
  • Agent puts business orchestration in filters - keep domain logic downstream.
  • Agent omits response timeouts - stalled upstreams can exhaust resources.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when adding Spring AI-specific model observations, token usage, latency, externally configured cost attribution, advisor telemetry, or protected prompt and completion logging. Use production-observability for general service metrics, health, logs, and OTLP setup.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when versioning Spring MVC or WebFlux APIs in Spring Boot 3 / Spring Framework 6. Covers explicit URL, header, and media-type strategies, compatibility rules, and deprecation handling.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when versioning Spring MVC or WebFlux APIs in Spring Boot 4 / Spring Framework 7. Covers built-in mapping versions, request version resolution, defaults, supported versions, and deprecation headers.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when introducing or correcting grouped Spring Boot configuration, typed property binding, validation, profiles or secret injection. Do not rewrite unrelated single-value configuration.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when packaging Spring Boot 4 as an OCI image, JVM container, AOT application, or GraalVM native executable. Covers buildpacks, layers, runtime hints, probes, security, and verification.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when packaging a Spring Boot 3 application as an OCI image or GraalVM native executable. Covers buildpacks, layered images, JVM containers, AOT hints, probes, security, and verification.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

rrezartprebreza のスキルをすべて見る

このスキルの問題を報告する