1
分離器之後,處理消息時發生異常。我想要處理這個異常,並將一條新消息引導至公共通道,並在消息的相關標識中產生異常,並提供一個指明錯誤的特殊標頭。如何引導在異常流程中保存當前關聯標識的新消息
我試着這樣說:
@Bean
public IntegrationFlow socialMediaErrorFlow() {
return IntegrationFlows.from("socialMediaErrorChannel")
.wireTap(sf -> sf.handle("errorService", "handleException"))
.handle((p, h) -> MessageBuilder.withPayload(p).copyHeaders(h).setHeader("ERROR", true).build())
.channel("directChannel_2")
.get();
}
但聚合返回此錯誤:
MessageHandlingException: error occurred in message handler [org.springframework.integration.dsl.AggregatorSpec$InternalAggregatingMessageHandler#0]; nested exception is java.lang.IllegalStateException: Null correlation not allowed. Maybe the CorrelationStrategy is failing?
我不能複製的相關ID在郵件標題中。
有誰知道我做錯了嗎?提前致謝。