Tagged articles
10 articles
Page 1 of 1
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
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 TracingMicroservicesObservability
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 BootTaskDecorator
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.

AsynchronousBackendJava
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