2012-04-10 91 views
2

我使用以下SI流量:Spring集成: 「沒有輸出通道或replyChannel頭可用」

<integration:gateway id="notificationGateway" 
      default-request-channel="start" 
      default-reply-channel="end" 
      service-interface="com.supplier.NotificationGateway"/> 
<integration:channel id="start"/> 
<integration:service-activator id="securedFileTransfer" 
        input-channel="start" 
        ref="Submitter" 
        method="submit" 
        output-channel="end"/> 
<integration:publish-subscribe-channel id="end"/> 

得到以下錯誤:

no output-channel or replyChannel header available?borg.springframework.integration.support.channel.ChannelResolutionException: no output-channel or replyChannel header available 

任何想法?

+1

你不應該看到,如果這是你的確切配置;如果某人過濾掉了replyChannel頭部,通常會發生這種情況 - 即使您在該消息沒有replyChannel頭部的情況下明確將回復發送給'end',網關也無法關聯響應請求。使用DEBUG日誌記錄運行,您將看到消息流以及其回覆通道頭。 – 2012-04-10 13:41:21

+0

謝謝加里。我能夠在Artem的大量幫助下找出原因。當我將消息對象從一個通道傳遞給另一個通道時,有一次我從有效負載構建消息而沒有複製標題,從而重置了_MessageHeaders.REPLY_CHANNEL_的值。 – 2012-04-10 14:41:37

回答

3

謝謝這篇文章幫了我很多。 貝婁是我用來創建從先前的頻道消息的消息頭中的代碼,與有效載荷myPayload新創建的消息

createSlotGateway.send(MessageBuilder.withPayload(myPayload).copyHeaders(messagePrev.getHeaders()).build()); 
相關問題