【问题标题】:getting the ID generated by sleuth in response of header section also获取 sleuth 生成的 ID 以响应标题部分
【发布时间】:2019-07-13 15:31:07
【问题描述】:

我已经开发了一个休息服务,并且我在我的 Spring Boot 休息项目中使用了侦探,它为日志中的每个 API 请求生成随机 id,它运行良好,现在关键是在日志中生成的 id通过添加 sleuth 依赖项,我怎样才能在该 API 请求的 headers 部分中获得相同的 id 响应,请告知我怎样才能实现相同

【问题讨论】:

    标签: rest spring-boot spring-cloud-sleuth


    【解决方案1】:

    您不需要手动添加它们,它们将由 Sleuth 为您添加。 见https://cloud.spring.io/spring-cloud-sleuth/2.1.x/single/spring-cloud-sleuth.html#_http_client_integration 只需注入上述 HTTP 客户端之一的 bean,就可以开始了。

    希望对您有所帮助! :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-03
      • 1970-01-01
      • 2016-11-06
      • 1970-01-01
      相关资源
      最近更新 更多