【发布时间】:2016-05-21 03:30:01
【问题描述】:
希望这是我在 Spring 集成中提出的最后一个问题。
面临以下问题:在相当长的 IntegrationFlow dsl 表的末尾有一段代码:
return IntegrationFlows.
//...
.enrichHeaders(headerEnricherSpec -> headerEnricherSpec.header("jms_replyTo", responseQueue(), true)) // IntegrationMessageHeaderAccessor.CORRELATION_ID is not acceptable though message came from outgoingGateway of another application with this header been set
.handle(requestRepository::save)
.handle(
Jms.outboundAdapter(queueConnectionFactory()).destination(serverQueue())
)
.get();
问题是像requestRepository::save 处理程序链这样的代码被破坏了。这个技巧只有在有网关作为处理程序参数传入时才有效。
我怎样才能克服这个限制?我认为在这里使用wireTap不会达成交易,因为它是异步的。在这里,实际上,我保存消息以存储它的jms_replyTo 标头,并在相应的回复从服务器返回后将其替换为已保存的消息(智能代理企业集成模式)。
有什么建议吗?
【问题讨论】:
标签: java spring spring-integration dsl