首页 > 解决方案 > 记录 @SqsListener 时缺少 TraceId

问题描述

在我的 Spring Boot 项目中,TraceId 仅在 @SqsListener 注释方法中丢失。我已用于spring-cloud-starter-sleuth日志记录和 logback 配置。

标签: spring-bootamazon-sqsspring-cloud-sleuthspring-logback

解决方案


Which sleuth version are you using? They removed SQS support since 3.0 release. https://github.com/spring-cloud/spring-cloud-sleuth/issues/1876.

This repo can be helpful in implementing putting traces into SQS messages but getting them from the message and injecting into MDC you need to implement on your own.


推荐阅读