weibocom / motan

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Other
5.88k stars 1.78k forks source link

Motan能支持跨线程传递上线文吗 #1037

Open FangWenjun opened 1 year ago

FangWenjun commented 1 year ago

Montan里有RpcContext里面使用的是ThreadLocal来存储上下文参数的,这种方式如果存在垮线程场景会导致上下文传输中断,这个有办法解决吗

rayzhang0603 commented 1 year ago

Motan的RpcContext是基于ThreadLocal机制,跨线程时需要自行透传对应的RpcContext,比如在生成异步执行的Runable任务时透传对应的RpcContext