Fescar and spring cloud integration can not get xid problem when using Feign service call #883
Labels
RPC: SpringCloud
Relate to seata SpringCloud
type: bug
Category issues or prs related to bug.
type: question
Category issues related to questions or problems
Hystrix会将请求放入Hystrix的线程池中去执行,此时会新启一个子线程处理请求。
而RootContext采用threadlocal传递数据,无法在子线程中传递,造成在子线程中通过RootContext.getXid()获取为空。
解决办法,在ThreadLocalContextCore类中,用InheritableThreadLocal 替代ThreadLocal。如下:
public class ThreadLocalContextCore implements ContextCore {
The text was updated successfully, but these errors were encountered: