HuangDayu commented on issue #5781: URL: https://github.com/apache/skywalking/issues/5781#issuecomment-721679275
# Producer Logger ```log 2020-11-04 19:19:04,443 INFO 14208 TID:5464bdfc220741749ed2eb3d2157879d.175.16044887444430451 [ntLoopGroup-5-7] c.n.i.c.g.t.a.h.InboundMessageHandler : traceId:5464bdfc220741749ed2eb3d2157879d.175.16044887444430451,uuid:496296fc-868c-4c82-97c4-95295c9c40af, message:helloABCDEFDCBA,targetId:496296fc-868c-4c82-97c4-95295c9c40af ``` # Consumer Logger ```log 2020-11-04 19:19:04,447 INFO 5944 TID:5464bdfc220741749ed2eb3d2157879d.173.16044887444390451 [ntainer#0-0-C-1] c.n.i.c.p.a.app.service.KafkaService : kafka headers sw8 values:[, 5464bdfc220741749ed2eb3d2157879d.175.16044887444430451, 5464bdfc220741749ed2eb3d2157879d.924.16044887444440154, , spring-cloud-app, [email protected], SpringAsync, 192.168.2.223:9092;192.168.2.224:9092;192.168.2.226:9092] 2020-11-04 19:19:04,447 INFO 5944 TID:5464bdfc220741749ed2eb3d2157879d.173.16044887444390451 [ntainer#0-0-C-1] c.n.i.c.p.a.app.service.KafkaService : traceId:5464bdfc220741749ed2eb3d2157879d.173.16044887444390451,uuid: 496296fc-868c-4c82-97c4-95295c9c40af ,message: helloABCDEFDCBA,targetId:496296fc-868c-4c82-97c4-95295c9c40af ``` 我修改了测试代码,将`kafka`的`header`的`sw8`的值输出,得到了一个惊人的结果:`sw8`的值中的traceId是正确的,但是`TraceContext.traceId()`的值却是错误的,且是之前消息的traceId,`TraceContext.getCorrelation(key)`也是如此。可以看出,kafka传输的header是没有问题的,至于为什么`TraceContext`对象的值却是旧的值,我不知如何debug,目前所以找不到问题所在。 I have modified the test code, will ` kafka ` ` of header of ` ` sw8 ` value output, received a surprising result: ` sw8 ` traceId in value is correct, but ` TraceContext. TraceId () ` value is wrong, and is traceId before the news, the ` TraceContext. GetCorrelation ` (key).As you can see, kafka's header is ok. As for why the value of 'TraceContext' object is old, I don't know how to debug, so I can't find the problem at present. @wu-sheng ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
