Spring 集成中链内内容的一般规则

General rule for what can be inside of a chain in Spring Integration

我需要使用 JPA 检索出站网关,我想将它与 header enricher 链接起来。为了做到这一点,我查看了文档以了解是否有一般规则可以知道端点是否在链内。我找不到关于什么可以或不可以的经验法则。

我正在尝试这样做的特殊情况:

<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>    

您可以将任何东西放入链中,但出站通道适配器或路由器(任何没有输出通道的东西 - 工具 MessageProducer)必须是最后一个元素。

http://docs.spring.io/spring-integration/reference/html/messaging-routing-chapter.html#chain