liubao68 commented on issue #1031: 关于jackson自定Serializer中调用ContextUtils.getInvocationContext()返回null问题 URL: https://github.com/apache/servicecomb-java-chassis/issues/1031#issuecomment-446834660 这段代码当前看是可以的,添加context前后也没有线程切换。 有风险的地方是ServiceComb后续的实现变更可能导致错误,不过可能性很小,依赖于实现的功能都会存在这样的情况,不用担心。 ContextUtils.setInvocationContext(invocation); 使用了ThreadLocal, 和你自己定义一个变量,作用是一样。 或者你自己定义一个临时使用,看起来风险又会小一点。
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
