![](/img/trans.png)
[英]How to get failedMessage from the payload in the ErrorMessage in spring cloud stream kafka?
[英]Payload of the ErrorMessage in ErrorChannel does not contain Kafka Topic
此問題之后的內容當代理不可用時,消息不會出現在Spring Integration(Kafka)ErrorChannel中
現在,我可以很好地運行它,並且在出現錯誤狀態以及相關的ErrorMessage時,將調用spring集成Kafka 默認的 ErrorChannel 。 我現在的問題是,我需要確定消息的主題 ,除了將其包括在消息標題中之外,沒有其他方法可以做到。
這樣做的最佳方法是什么?我是否要創建一個與一個且僅一個主題相關聯的特殊 errorChannel?
錯誤消息的payload.failedMessage
屬性是到達適配器的原始消息。
您可以在適配器的上游使用<header-enricher />
,將標題kafka_topic
設置為該主題。 如果適配器上未配置任何topic
或topic-expression
則使用默認機制。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.