【问题标题】:Payload enrichment via gateway通过网关丰富有效负载
【发布时间】:2016-02-10 14:25:12
【问题描述】:

我希望能够从数据库存储过程的 ResultSet 中丰富我的有效负载。目前我编写了一个服务,它与一个服务激活器一起,从数据库中获取值并将其分配给一些字段。

现在我想切换到int-jdbc,但无法将int-jdbc:stored-proc-outbound-gatewayint:enricher 结合使用。我想根据这个Spring's wiki header enrichment 起草一个解决方案,但是由于需要网关的service-interface 参数,所以这种方法行不通。

<int:header-enricher input-channel="input" output-channel="output">                                 
    <int:header name="status" expression="@statusFlow.exchange(#root).payload['STATUS']" />
</int:header-enricher>

<int:gateway id="statusFlow" default-request-channel="getStatusForDeal" />                          

<int:chain input-channel="getStatusForDeal">
    <int:transformer expression="payload.dealId" />
    <jdbc:outbound-gateway query="select status from trade_details where dealId = :payload"
        data-source="dataSource" />                                                        
</int:chain>

你知道如何在 Spring 3.0+ 中实现这样的负载丰富吗?换句话说:如何实现payload交换或者是哪个概念取代了它?

【问题讨论】:

    标签: java spring spring-integration


    【解决方案1】:

    正如我在 wiki 文章中所述;该技术现已过时;您现在可以使用 &lt;enricher/&gt; as documented here 设置标头和有效负载属性。

    【讨论】:

    • Gary,我询问了丰富器,刚刚发布了网站上与 header-enricher 相关的示例。我要问的是如何使用来自stored-proc-outbound-gateway 的 ResultSet 来丰富消息
    • 我不知道你说的but since service-interface parameter of the gateway is required, this approach wouldn't work.是什么意思。请澄清。阅读浓缩器部分,然后返回一些明确的问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-30
    • 2017-07-20
    • 1970-01-01
    • 2016-07-12
    • 2017-06-21
    • 1970-01-01
    相关资源
    最近更新 更多