如何将Spring Integration XML转换为Java DSL



我的应用程序中有以下xml配置,我想将其转换为Java DSL。

<int:chain
input-channel="preparedOrder-InputChannelTransformer"
output-channel="preparedOrder-OutputChannel">
<int:json-to-object-transformer
type="service.prepareOrder.PreparedOrder" />
<int:header-enricher>
<int:header name="messageID"
expression="headers['id'].toString()" />
</int:header-enricher>
<int:filter expression="payload.delay &lt; 5" />
</int:chain>
<int:chain input-channel="preparedOrder-OutputChannel"
output-channel="billingServiceAcivatorOutput"
id="service-activator-chain-billingChannel-id">
<int:service-activator
id="service-activator-billingChannel-id">
<int-script:script lang="js"
location="file:src/main/orcha/service/billing/billing.js" />
<int:request-handler-advice-chain />
</int:service-activator>
</int:chain>
<int:transformer
id="transformer-billingServiceAcivatorOutput-id"
input-channel="billingServiceAcivatorOutput"
output-channel="billingAggregatorInput" method="transform">
<bean
class="orcha.lang.compiler.referenceimpl.xmlgenerator.impl.ObjectToApplicationTransformer">
<property name="application" ref="billing" />
</bean>
</int:transformer>
<int:aggregator id="aggregator-billingAggregatorInput-id"
input-channel="billingAggregatorInput"
output-channel="billingAggregatorInputTransformer"
release-strategy-expression="size()==1 and ( ([0].payload instanceof T(orcha.lang.configuration.Application) AND [0].payload.state==T(orcha.lang.configuration.State).TERMINATED) )"
correlation-strategy-expression="headers['messageID']" />
<int:transformer
id="transformer-billingAggregatorInput-id"
input-channel="billingAggregatorInputTransformer"
output-channel="billingAggregatorInputAggregatorOutput"
expression="payload.?[name=='billing']" />
<int:transformer
id="transformer-billingAggregatorInputAggregatorOutput-id"
input-channel="billingAggregatorInputAggregatorOutput"
output-channel="billingAggregatorOutputTransformer" method="transform">
<bean
class="orcha.lang.compiler.referenceimpl.xmlgenerator.impl.ApplicationToObjectTransformer" />
</int:transformer>
<int:chain input-channel="billingAggregatorOutputTransformer"
output-channel="billingOutputFileChannelAdapteraccounting">
<int:object-to-json-transformer />
</int:chain>
<int:channel id="billingOutputFileChannelAdapteraccounting" />
<int-file:outbound-channel-adapter
id="file-billingaccountingChannel-id"
channel="billingOutputFileChannelAdapteraccounting"
directory-expression="@accounting.output.adapter.directory"
filename-generator-expression="@accounting.output.adapter.filename"
append-new-line="true" mode="REPLACE" auto-create-directory="true"
delete-source-files="false" />
@Bean
IntegrationFlow flow() {
IntegrationFlows.from("preparedOrder-InputChannelTransformer")
.transform(Transformers.fromJson())
.enrichHeaders(...)
.handle(...)
.transform(objToAppTransformer())
.aggregate(...)
.transform("payload.?[name=='billing']")
.transform(appToObjTransformer())
.transform(Transformers.toJson())
.handle(files.outboundAdapter(...))
.get();
}

相关内容

  • 没有找到相关文章

最新更新