SpringCloud Spring Integration和Spring Cloud Stream

2023-12-03 18:55 更新

Spring Cloud Sleuth與Spring Integration集成。它為發(fā)布和訂閱事件創(chuàng)建spans。要禁用Spring Integration檢測(cè),請(qǐng)將??spring.sleuth.integration.enabled設(shè)置為false。

您可以提供spring.sleuth.integration.patterns模式來顯式提供要包括以進(jìn)行跟蹤的通道的名稱。默認(rèn)情況下,除hystrixStreamOutput通道以外的所有通道都包括在內(nèi)。

 使用Executor構(gòu)建Spring Integration IntegrationFlow時(shí),必須使用Executor的未跟蹤版本。TraceableExecutorService裝飾Spring Integration執(zhí)行器通道會(huì)導(dǎo)致spans被不正確地關(guān)閉。

如果要自定義從消息頭讀取和向消息頭寫入跟蹤上下文的方式,就足以注冊(cè)類型的beans:

  • Propagation.Setter<MessageHeaderAccessor, String>-用于將標(biāo)頭寫入消息
  • Propagation.Getter<MessageHeaderAccessor, String>-用于從郵件中讀取標(biāo)題
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)