webflux-reactive-patterns
/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.
- Author
- rrezartprebreza ↗
- Repository
- spring-boot-skills ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 4
- Scripts
- 2
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 2 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: examples/bad-reactive-service.java, examples/good-reactive-service.java
What it does and when to use it
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.
Original author description
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.
How it works
- Pipeline rules
- Context and errors
- Persistence and streaming
- Testing
- Examples
- Gotchas
SKILL.md preview
--- name: webflux-reactive-patterns description: > 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. --- # 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.
Files in this package (4)
- SKILL.md 2 KB
- agents/openai.yaml 1 KB
- examples/bad-reactive-service.java 1 KB
- examples/good-reactive-service.java 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · rrezartprebreza/spring-boot-skills | 100 | MIT |
| rrezartprebreza/spring-boot-skills | 100 | MIT |
Database snapshot: 13.11.2026 · package version 14d60eb13f61 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100spring-r2dbc
Spring Data R2DBC for reactive database access in Spring Boot 3.x. Covers R2dbcRepository, DatabaseClient, reactive transactions, and WebFlux integration. USE WHEN: user mentions "r2dbc", "reactive database", "R2dbcRepository", "DatabaseClient", "reactive SQL", "WebFlux… - 100spring-boot-engineer
Generates Spring Boot 3.x configurations, creates REST controllers, implements Spring Security 6 authentication flows, sets up Spring Data JPA repositories, and configures reactive WebFlux endpoints. Use when building Spring Boot 3.x applications, microservices, or reactive Java… - 100spring-boot-engineer
Generates Spring Boot 3.x configurations, creates REST controllers, implements Spring Security 6 authentication flows, sets up Spring Data JPA repositories, and configures reactive WebFlux endpoints. Use when building Spring Boot 3.x applications, microservices, or reactive Java… - 100spring-boot-web-api
Spring Boot 4 REST API implementation patterns. Use when creating REST controllers, REST endpoints, request validation, exception handlers with ProblemDetail (RFC 9457), API versioning, content negotiation, WebFlux reactive endpoints, HTTP clients with @HttpExchange, JSON… - 100spring-boot-engineer
Generates Spring Boot 3.x configurations, creates REST controllers, implements Spring Security 6 authentication flows, sets up Spring Data JPA or MyBatis-Plus data access, and configures reactive WebFlux endpoints. Use when building Spring Boot 3.x applications, microservices,… - 90java-spring-boot-expert
Use when building Spring Boot 3.x applications, microservices, or reactive Java applications. Invoke for Spring Data JPA, Spring Security 6, WebFlux, Spring Cloud integration.