Skip to content

Conversation

@kissMeet
Copy link

作者在springCloud客户端中的RestTemplateConfiguration自定义Feign.Builder拦截Feign请求传递GroupId,这与开启hystrix冲突,feign开启hystrix后,定义了SleuthHystrixFeignBuilder,Feign.Builder全局只能有一个。

解决方法:改用bean的方式添加自定义的RequestInterceptor

然后发现事务参与者获取RequestContextHolder.getRequestAttributes()为null
原因:RequestContextHolder是一个threadlocal变量,事务参与者是新开线程执行的,传递不过去,需要在ActorTxTransactionHandler中传递一下RequestContextHolder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant