我需要使用JPA检索出站网关,并且希望将其与标头扩充程序链接起来。为了做到这一点,我仔细阅读了文档,以了解是否有一条通用规则可以知道端点是否可以在链中。我找不到关于可以做什么或不可以做什么的经验法则。
我的特殊情况下,我试图这样做:
<int:chain input-channel="audTrailRetrievalChannel" output-channel="updateResponseForTestSent">
<int-jpa:retrieving-outbound-gateway id="getAudTrail" jpa-query="select e.details from AudTrail e where e.audTrailRecId = :id" entity-manager-factory="auditEntityManager">
<int-jpa:parameter name="id" expression="payload?.body?.response?.responseInformation?.communicationVariables?.variable.?[variableName=='audTrailRecId'][0]?.variableValue"/>
</int-jpa:retrieving-outbound-gateway>
<int:header-enricher>
<int:header name="registerMethod" value="registerAuditTrail" overwrite="true"/>
</int:header-enricher>
</int:chain>
您可以将任何东西放在链中,但出站通道适配器或路由器(没有输出通道的任何东西-Implement MessageProducer
)必须是最后一个元素。
http://docs.spring.io/spring-integration/reference/html/messaging-routing-chapter.html#chain
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句