首页 文章

Spring Integration:从出站通道适配器返回非空回复

提问于
浏览
0

我有一个带有2个出站通道适配器的通道,它们都返回一个包含其活动结果的Message对象 . 这曾经有效,直到升级到SI 2.1 . 现在,由于方法返回非空值,我收到错误消息 .

这是一个代码示例:

<integration:gateway id="notificationGateway"
                     default-request-channel="notificationRecordsFetcher" 
                     default-reply-channel="notifySupplier"
                     service-interface="com.supplier.NotificationGateway"/>

<!-- Submit the file to the supplier-->
<integration:channel id="notifySupplier"/>

<!-- Handle the secured transfer (first) -->
<integration:outbound-channel-adapter order="1" channel="notifySupplier" id="SupplierSecuredFileTransfer" ref="SubmitToSupplier" method="submit" />

<!-- Delete the notification records marked as successful (second) -->
<integration:outbound-channel-adapter order="2" channel="notifySupplier" id="deleteNotificationRecords" ref="databaseService" method="removeNotificationEntries" />

标识为“SupplierSecuredFileTransfer”的适配器接收一堆XML文件,每个文件代表一个数据库记录,并使用SFTP将它们发送到目标文件夹 . 然后它标记成功传递的记录,并将它们作为回复发送到标识为“deleteNotificationRecords”的第二个适配器,后者又读取第一个更新的消息有效负载并对其执行 . 现在,由于引入了新的限制,我无法在适配器之间传递信息 . 任何想法如何克服这个?

1 回答

  • 0

    您从哪个版本迁移?

    将<outbound-channel-adapter />更改为<service-activator /> s,将channel更改为input-channel并将output-channel设置为“nullChannel” .

相关问题