# alibaba/transmittable-thread-local

📌 a missing Java std lib(simple & 0-dependency) for framework/middleware, provide an enhanced InheritableThreadLocal that transmits values between threads even using thread pooling components.

Repository: https://github.com/alibaba/transmittable-thread-local
Canonical: https://ross.abutalabs.com/products/transmittable-thread-local
Homepage: https://github.com/alibaba/transmittable-thread-local
Language: Java
License: Apache-2.0
License Family: permissive
Topics: java, threadlocal, threadsafe, transmittable, context, thread-pool, executor, transmittable-thread-local, middleware, framework, apm, distributed-tracing, dapper, tracing, async, asynchronous, async-context, forkjoinpool, asynchronous-context
Last push: 2026-06-18T20:17:43+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 88, release rhythm 8, longevity 100
- inputs: {"age_days": 4707, "days_push": 76, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8293, forks 1722 (observed 2026-08-28T04:10:20.105517+00:00)

## What it is
TransmittableThreadLocal (TTL) is a zero-dependency Java library providing an enhanced InheritableThreadLocal that transmits context values between threads even when thread pools reuse threads. It includes a Java Agent to transparently instrument JDK thread pool implementations like ExecutorService and ForkJoinPool.

## Use cases
- pass request context through thread pools in Java middleware
- propagate trace IDs across async tasks for distributed tracing
- transmit ThreadLocal values when using ExecutorService or ForkJoinPool
- maintain user session context in pooled threads
- build APM or tracing frameworks that need async context propagation
- wrap Runnable and Callable to carry context across thread boundaries

## When to choose
- your Java framework or middleware needs context propagation through pooled threads
- InheritableThreadLocal fails because threads are reused from a pool
- you want a simple, zero-dependency solution with optional Java Agent instrumentation
- you're building distributed tracing or APM tooling on the JVM

## When to avoid
- you don't use thread pools or async execution
- you're on a non-JVM platform
- you need coroutine or reactive-stream context propagation instead of thread-based

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, middleware, tracing, developer-tools
- domain: developer-tools, microservices, backend, monitoring
- platform: jvm
- tags: threadlocal, thread-pool, context-propagation, async, executor, java-agent, zero-dependency

## Member repositories
- alibaba/transmittable-thread-local (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:20.105517+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:28:05.545297+00:00, confidence not recorded.
  - readme: https://github.com/alibaba/transmittable-thread-local (fetched 2026-08-28T04:10:20.105517+00:00, sha 7c783974c509)
  - homepage: https://github.com/alibaba/transmittable-thread-local (fetched 2026-08-29T08:27:42.714916+00:00, sha 0dd07db4bf08)
- Data as of 2026-08-30T08:39:29.467469+00:00.
