Tagged articles

TransmittableThreadLocal

16 articles · Page 1 of 1
Code Ape Tech Column
Code Ape Tech Column
May 25, 2026 · Backend Development

Why Does TraceId Get Mixed Up Under High Concurrency Even Though the Parent Thread Passes It to Child Threads?

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
Why Does TraceId Get Mixed Up Under High Concurrency Even Though the Parent Thread Passes It to Child Threads?
Programmer XiaoFu
Programmer XiaoFu
May 19, 2026 · Backend Development

Why Does TraceId Get Mixed Up Under High Concurrency Even Though the Parent Thread Passes It to Child Threads?

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
Why Does TraceId Get Mixed Up Under High Concurrency Even Though the Parent Thread Passes It to Child Threads?
Lobster Programming
Lobster Programming
May 18, 2026 · Fundamentals

Why userId Gets Lost in Async Calls and How ThreadLocal Solves It

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
Why userId Gets Lost in Async Calls and How ThreadLocal Solves It
JavaGuide
JavaGuide
Feb 11, 2026 · Backend Development

Do ThreadLocal Values Fail in Asynchronous Scenarios? An Interviewer's Trick Question Explained

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
Do ThreadLocal Values Fail in Asynchronous Scenarios? An Interviewer's Trick Question Explained
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
Eric Tech Circle
Eric Tech Circle
Aug 15, 2024 · Backend Development

Lightweight Distributed Tracing in Spring Cloud Without Third‑Party Tools

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
Lightweight Distributed Tracing in Spring Cloud Without Third‑Party Tools
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Aug 14, 2024 · Backend Development

How to Safely Pass ThreadLocal Values Across Thread Pools with TTL

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.

TTLThreadPoolTransmittableThreadLocal
0 likes · 10 min read
How to Safely Pass ThreadLocal Values Across Thread Pools with TTL
Su San Talks Tech
Su San Talks Tech
Apr 30, 2024 · Backend Development

Mastering Context Propagation in Thread Pools with TransmittableThreadLocal

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.

ContextPropagationJavaThreadLocal
0 likes · 12 min read
Mastering Context Propagation in Thread Pools with TransmittableThreadLocal
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
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 17, 2023 · Fundamentals

How to Pass Values Between Parent and Child Threads with InheritableThreadLocal and TransmittableThreadLocal

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.

InheritableThreadLocalJavaThreadLocal
0 likes · 10 min read
How to Pass Values Between Parent and Child Threads with InheritableThreadLocal and TransmittableThreadLocal
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 4, 2023 · Backend Development

Implement Distributed Log Tracing in Spring Boot with MDC and traceId

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
Implement Distributed Log Tracing in Spring Boot with MDC and traceId
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.

AsynchronousJavaSpring Boot
0 likes · 13 min read
Elegant Methods for Passing Data Between Parent and Child Threads in Spring Boot
Code Ape Tech Column
Code Ape Tech Column
Jun 2, 2022 · Backend Development

Using Alibaba's TransmittableThreadLocal to Propagate ThreadLocal Variables in Thread Pools

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.

JavaThreadLocalThreadPool
0 likes · 13 min read
Using Alibaba's TransmittableThreadLocal to Propagate ThreadLocal Variables in Thread Pools
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Jul 17, 2021 · Backend Development

How to Preserve Trace Context Across Asynchronous Java Threads with TransmittableThreadLocal

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
How to Preserve Trace Context Across Asynchronous Java Threads with TransmittableThreadLocal
vivo Internet Technology
vivo Internet Technology
Jan 27, 2021 · Backend Development

TransmittableThreadLocal Practice: Solving Multi-Country Business Context Propagation in E-commerce

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
TransmittableThreadLocal Practice: Solving Multi-Country Business Context Propagation in E-commerce