{"id":55788,"library":"transmittable-thread-local","title":"TransmittableThreadLocal","description":"TransmittableThreadLocal enhances InheritableThreadLocal to transmit values across threads even when using thread pools, solving context propagation issues.","status":"active","version":"2.14.5","language":"java","source_language":null,"source_url":"https://github.com/alibaba/transmittable-thread-local","tags":["thread-local","context-propagation","concurrency","alibaba","java"],"install":[{"cmd":"<dependency>\n  <groupId>com.alibaba</groupId>\n  <artifactId>transmittable-thread-local</artifactId>\n  <version>2.14.5</version>\n</dependency>","lang":"xml","label":"Maven"},{"cmd":"implementation 'com.alibaba:transmittable-thread-local:2.14.5'","lang":"groovy","label":"Gradle"}],"dependencies":[],"imports":[{"symbol":"TransmittableThreadLocal","correct":"com.alibaba.ttl.TransmittableThreadLocal"}],"quickstart":{"code":"import com.alibaba.ttl.TransmittableThreadLocal;\n\nTransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();\ncontext.set(\"main-thread-value\");\n\nExecutorService executor = Executors.newFixedThreadPool(1);\nexecutor.submit(() -> {\n    System.out.println(context.get()); // prints \"main-thread-value\"\n});","lang":"java","description":"Use TransmittableThreadLocal to propagate a value from main thread to a thread pool task."},"warnings":[{"fix":"Wrap tasks with TtlRunnable.get() or use TtlExecutors.","message":"TransmittableThreadLocal requires explicit TtlRunnable or TtlCallable wrapping for thread pools; otherwise values may not transmit.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'across':8 'alibaba':26 'concurr':25 'context':16,23 'context-propag':22 'enhanc':3 'even':10 'inheritablethreadloc':4 'issu':18 'java':27 'local':21 'pool':14 'propag':17,24 'solv':15 'thread':9,13,20 'thread-loc':19 'transmit':6 'transmittablethreadloc':1,2 'use':12 'valu':7","created_at":"2026-06-15T10:07:27.366460+00:00","updated_at":"2026-06-15T10:07:27.366460+00:00","problems":[],"ecosystem":"maven","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/alibaba/transmittable-thread-local","github":"https://github.com/alibaba/transmittable-thread-local","docs":"https://appdoc.app/artifact/com.alibaba/transmittable-thread-local/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}