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

webflux-reactive-patterns

Use when the complete Spring Boot 3 request path is reactive: WebFlux controllers, Reactor pipelines, R2DBC persistence, streaming, backpressure, or cancellation. For defining and registering declarative outbound API interfaces, use http-interface-clients.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md2.2 KB
  • agents/openai.yaml216 B
  • examples/bad-reactive-service.java115 B
  • examples/good-reactive-service.java705 B

SKILL.md(原文)

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

WebFlux Reactive Patterns

Use WebFlux when the complete request path can benefit from non-blocking I/O.

Pipeline rules

  • Return Mono or Flux; do not call subscribe() in request-handling code.
  • Compose work with map, flatMap, concatMap, and zip according to ordering requirements.
  • Keep blocking JDBC, filesystem, and legacy SDK calls out of event-loop threads.
  • Isolate unavoidable blocking calls on boundedElastic at the narrow adapter boundary.
  • Apply timeouts at remote-call boundaries and preserve cancellation.

Context and errors

  • Put request-scoped metadata in Reactor Context, not ThreadLocal.
  • Translate domain failures centrally without swallowing cancellation or infrastructure errors.
  • Use onErrorResume only when a defined fallback exists.
  • Avoid onErrorContinue; it makes partial processing hard to reason about.

Persistence and streaming

  • Use R2DBC for reactive database access; JDBC makes the pipeline blocking.
  • Bound concurrency for fan-out operations.
  • Define backpressure and buffering limits for streaming endpoints.
  • Avoid collecting an unbounded Flux into memory.

Testing

  • Use StepVerifier for publisher behavior and WebTestClient for HTTP contracts.
  • Test cancellation, timeout, empty results, errors, ordering, and backpressure.
  • Enable blocking-call detection in tests when the project supports it.

Examples

  • See examples/good-reactive-service.java and examples/bad-reactive-service.java.

Gotchas

  • Agent calls block() in a controller or service - keep the full request path non-blocking.
  • Agent calls subscribe() manually - the web runtime owns subscription.
  • Agent stores tenant or security data in ThreadLocal - use Reactor Context.
  • Agent uses unbounded flatMap - set concurrency according to downstream capacity.
  • Agent wraps JDBC in Mono.just - that still blocks the caller thread.

レビュー

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

同じリポジトリのスキル

概要と使いどころ

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 のスキルをすべて見る

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