代码之家  ›  专栏  ›  技术社区  ›  djdecks8767

Spring集成将xml配置转换为java配置

  •  2
  • djdecks8767  · 技术社区  · 8 年前

    <file:inbound-channel-adapter id="filesIn" directory="file:${java.io.tmpdir}/spring-integration-samples/input"
                                  filename-regex="^.*\.(xml|json)$" >
        <int:poller id="poller" fixed-delay="5000"/>
    </file:inbound-channel-adapter>
    
    
    <int:service-activator input-channel="filesIn"
                           output-channel="filesOut"
                           ref="handler"/>
    
    <file:outbound-channel-adapter id="filesOut" directory="file:${java.io.tmpdir}/spring-integration-samples/output"
                                   delete-source-files="true"/>
    
    
    
    <file:inbound-channel-adapter id="filesContent" directory="file:${java.io.tmpdir}/spring-integration-samples/output"
                                  filename-regex="^.*\.(xml|json)$" prevent-duplicates="true">
        <int:poller id="poller2" fixed-delay="5000"/>
     </file:inbound-channel-adapter>
    

    1 回复  |  直到 8 年前
        1
  •  2
  •   Artem Bilan    8 年前

    首先,你应该从 Spring Integration Java DSL Reference Manual 在这里,您将发现Java DSL的一般概念以及它与XML配置的关系。

    Chapter .例如 <int:service-activator>

    .handle(handler)
    

    如果您在单个 IntegrationFLow .