Tagged articles
TransmittableThreadLocal
17 articles · Page 1 of 1
This article explains how a static ThreadLocal without cleanup in a thread pool causes user data leakage and memory leaks, details ThreadLocalMap's weak-reference Entry structure, demonstrates InheritableThreadLocal's failure with pooled threads, and presents solutions including try-finally cleanup, interceptor-based clearing, Alibaba's TransmittableThreadLocal, and an AutoCloseable wrapper for safe scoping.
AutoCloseableInheritableThreadLocalJava Concurrency
0 likes · 10 min read

The article explains why InheritableThreadLocal fails to propagate TraceId correctly in high‑concurrency thread‑pool scenarios, demonstrates the mixing problem with concrete request examples, and presents both manual propagation and Alibaba's TransmittableThreadLocal as reliable solutions.
Context PropagationInheritableThreadLocalJava Concurrency
0 likes · 7 min read

The article explains why InheritableThreadLocal fails to propagate TraceId correctly in thread‑pool scenarios under high load, illustrates the problem with concrete request examples, and presents manual propagation and Alibaba's TransmittableThreadLocal as solutions.
InheritableThreadLocalJava ConcurrencyThreadPoolExecutor
0 likes · 7 min read

The article explains ThreadLocal's lifecycle, why userId disappears when spawning asynchronous threads, compares ThreadLocal, InheritableThreadLocal, and Alibaba's TransmittableThreadLocal, and shows how the latter prevents data contamination in thread‑pool reuse.
InheritableThreadLocalJava ConcurrencyThreadLocal
0 likes · 5 min read

This article explains why ThreadLocal values are not automatically transferred in asynchronous or thread‑pool contexts, compares JDK's InheritableThreadLocal with Alibaba's TransmittableThreadLocal (TTL), and shows how TTL captures, replays, and restores context safely with code examples and diagrams.
Context PropagationInheritableThreadLocalJava Concurrency
0 likes · 13 min read

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.
ConcurrencyJavaSpring Boot
0 likes · 13 min read

This article explains four techniques—manual setting, TaskDecorator, InheritableThreadLocal, and TransmittableThreadLocal—for propagating context such as user information from a parent thread to child threads in Spring Boot asynchronous execution, providing code examples and recommendations.
AsyncJavaSpring Boot
0 likes · 14 min read

This guide shows how to implement end‑to‑end trace ID propagation across Spring Cloud gateways, downstream services, and asynchronous threads using a custom GlobalTraceFilter, a patched LogbackMDCAdapter with Alibaba TransmittableThreadLocal, and minimal configuration, avoiding heavyweight tracing libraries.
Distributed TracingLogbackMDC
0 likes · 5 min read

This article explains the limitations of Java's ThreadLocal and InheritableThreadLocal in thread‑pool scenarios, introduces Alibaba's open‑source TransmittableThreadLocal (TTL) library, and provides detailed code examples for safely transmitting thread‑local data across threads, thread pools, and even via Java agents.
ConcurrencyTTLThreadPool
0 likes · 10 min read

This article explains why standard ThreadLocal mechanisms fail with thread pools, introduces the design of a custom solution using YesThreadLocal and YesRunnable, and then details how Alibaba's TransmittableThreadLocal (TTL) implements context capture, replay, and restoration for seamless asynchronous execution.
ConcurrencyContextPropagationJava
0 likes · 12 min read

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.
Asynchronous ProgrammingJavaSpring Boot
0 likes · 13 min read

The article explains why regular ThreadLocal cannot share data from a parent thread to its child, introduces InheritableThreadLocal as a built‑in solution, shows its limitation with thread‑pool reuse, and demonstrates how Alibaba's TransmittableThreadLocal overcomes this issue with concrete code examples and output.
ConcurrencyInheritableThreadLocalJava
0 likes · 10 min read

This guide explains how to add a unique traceId to each request in a Spring Boot application, configure Logback/MDC to record it, propagate the ID across microservice calls and asynchronous threads using OpenFeign, RestTemplate, and TransmittableThreadLocal, enabling complete distributed log tracing.
Distributed TracingLogbackMDC
0 likes · 18 min read

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.
BackendJavaSpring Boot
0 likes · 13 min read

This article explains why InheritableThreadLocal fails in pooled threads, introduces Alibaba's TransmittableThreadLocal library, demonstrates how to wrap executors and rewrite code to correctly transmit ThreadLocal data across parent‑child threads in Java thread pools, and provides detailed implementation and usage examples.
ConcurrencyJavaThreadLocal
0 likes · 13 min read

This article explains why ThreadLocal‑based trace information is lost in asynchronous Java calls, compares InheritableThreadLocal and the Alibaba‑provided TransmittableThreadLocal library, shows how to wrap runnables with TtlRunnable, and demonstrates a Java Agent solution for transparent thread‑pool propagation.
InheritableThreadLocalJavaThreadLocal
0 likes · 9 min read

The article explains how to reliably propagate country‑specific context across request handling, database access, and asynchronous thread pools in multi‑country e‑commerce by replacing simple ThreadLocal and InheritableThreadLocal with Alibaba’s TransmittableThreadLocal, demonstrating its integration with Spring MVC/Boot, MyBatis, Dubbo, and custom executors for both sharded and non‑sharded databases.
AlibabaInheritableThreadLocalJava Concurrency
0 likes · 16 min read
