← ClaudeAtlas

async-executionlisted

Use when adding or debugging Spring @Async work, executor saturation, asynchronous failures or lost thread context. Not a substitute for durable jobs or reactive pipelines.
rrezartprebreza/spring-boot-skills · ★ 357 · AI & Automation · score 89
Install: claude install-skill rrezartprebreza/spring-boot-skills
# Async Execution ## Spring Boot 4 baseline Use Framework 7 APIs and the project's Boot BOM. The shipped examples compile on Java 17. Virtual threads require Java 21 and explicit Boot configuration. They are not enabled merely by upgrading to Boot 4. Preserve the project's executor choices and check the exact minor. ## Choose the execution boundary First decide whether losing work on process exit is acceptable. In-memory async work is not a durable queue. Required notifications, payments and accepted background jobs need persisted intent plus recovery, not just an AFTER_COMMIT listener or an HTTP 202 response. Keep an existing broker or job framework when it already owns this contract. Enable async interception once and call a separate Spring bean through its proxy. A same-class call does not become asynchronous. Use a named executor and return CompletableFuture when the caller must observe failure. A void method needs an AsyncUncaughtExceptionHandler; the caller cannot catch its later failure. Rejection can happen synchronously during submission. See [the bounded executor](templates/ReportExecutorConfiguration.java) and [the worker](templates/ReportTasks.java). Sizes are example budgets, not universal defaults. [Good usage](examples/good-report-call.java) separates rejected submissions from failed work; [bad usage](examples/bad-self-invocation.java) hides both the execution and capacity problems. ## Capacity and lifecycle Bound threads and queued work against downstr