Tagged articles

taskdecorator

7 articles · Page 1 of 1
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
May 28, 2026 · Backend Development

5 Advanced Techniques to Preserve Context in Spring Boot Async Calls

In Spring Boot 3.5.0, asynchronous threads lose MDC, security, and request data because ThreadLocal is not shared; the article demonstrates five concrete solutions—including InheritableThreadLocal, thread joining, custom TaskDecorator, Spring Security delegating wrappers, and MDC propagation—each with code samples, pitfalls, and best‑practice warnings.

InheritableThreadLocalMDCSpring Boot
0 likes · 12 min read
5 Advanced Techniques to Preserve Context in Spring Boot Async Calls
WeiLi Technology Team
WeiLi Technology Team
Mar 31, 2026 · Backend Development

Why ThreadLocal Leaks Cause Full GC in Thread Pools and How to Fix It

An online service experienced frequent Full GC due to a ThreadLocal memory leak in a thread‑pool scenario; the article walks through GC log analysis, heap dump inspection, root‑cause discovery in ThreadFactory logic, and presents a robust fix using Spring’s TaskDecorator to ensure proper cleanup.

GCJavaSpring
0 likes · 14 min read
Why ThreadLocal Leaks Cause Full GC in Thread Pools and How to Fix It
Programmer XiaoFu
Programmer XiaoFu
Dec 12, 2024 · Backend Development

4 Elegant Ways to Transfer Data Between Async Threads in Spring Boot

The article compares four techniques—manual ThreadLocal copying, TaskDecorator, InheritableThreadLocal, and Alibaba's TransmittableThreadLocal—for passing user context and other data from parent to child threads in Spring Boot async execution, recommending the TaskDecorator and TransmittableThreadLocal approaches for production use.

JavaSpring BootThreadLocal
0 likes · 13 min read
4 Elegant Ways to Transfer Data Between Async Threads in Spring Boot
Code Ape Tech Column
Code Ape Tech Column
Sep 22, 2023 · Backend Development

Elegant Ways to Transfer Data Between Parent and Child Threads in Spring Boot

This article introduces four methods—manual setting, TaskDecorator, InheritableThreadLocal, and TransmittableThreadLocal—to propagate contextual data such as user information from a parent thread to child threads in Spring Boot asynchronous execution, providing code examples and practical recommendations.

JavaSpring BootThreadLocal
0 likes · 13 min read
Elegant Ways to Transfer Data Between Parent and Child Threads in Spring Boot
Code Ape Tech Column
Code Ape Tech Column
Jan 4, 2023 · Backend Development

Elegant Methods for Passing Data Between Parent and Child Threads in Spring Boot

This article explains four techniques—including manual setting, TaskDecorator, InheritableThreadLocal, and TransmittableThreadLocal—to reliably transfer user context and other thread‑local data from parent to child threads in Spring Boot asynchronous execution, with complete code samples and best‑practice recommendations.

JavaSpring BootThreadLocal
0 likes · 13 min read
Elegant Methods for Passing Data Between Parent and Child Threads in Spring Boot