这就是我的工作。
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:prop="http://camel.apache.org/schema/placeholder"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<cm:property-placeholder persistent-id="com.ge.digital.passthru.core" />
<bean id="deadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="${deadLetterQueue}"/>
<property name="redeliveryPolicy" ref="redeliveryPolicyConfig"/>
<property name="useOriginalMessage" value="true" />
</bean>
<bean id="redeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
<property name="maximumRedeliveries" value="3"/>
<property name="redeliveryDelay" value="5000" />
</bean>
…
<camelContext
id="com.ge.digital.passthru.coreCamelContext"
trace="true"
xmlns="http://camel.apache.org/schema/blueprint"
allowUseOriginalMessage="false"
streamCache="true"
errorHandlerRef="deadLetterErrorHandler" >
…
<route
id="core.predix.accept.file.type.route"
autoStartup="true" >
<from uri="{{fileEntranceEndpoint}}" />
<convertBodyTo type="java.lang.String" />
<split streaming="true" strategyRef="csvAggregationStrategy">
<tokenize token="\n" />
<process ref="toCsvFormat" /> <!-- passthru only we do not allow embedded commas in numeric data -->
</split>
<log message="CSV body: ${body}" loggingLevel="INFO"/>
<choice>
<when>
<simple>${header.CamelFileName} regex '^.*\.(csv|CSV|txt|gpg)$'</simple>
<log message="${file:name} accepted for processing..." />
<choice>
<when>
<simple>${header.CamelFileName} regex '^.*\.(CSV|txt|gpg)$'</simple>
<setHeader headerName="CamelFileName">
<!-- <simple>${file:name.noext}.csv</simple> --> <!-- file:name.noext.single -->
<simple>${file:name.noext.single}.csv</simple>
</setHeader>
<log message="${file:name} changed file name." />
</when>
</choice>
<split streaming="true" >
<tokenize token="\n" prop:group="noOfLines" />
<log message="Split Group Body: ${body}"/>
<to uri="bean:extractHeader" />
<to id="acceptedFileType" ref="predixConsumer" />
</split>
<to uri="bean:extractHeader?method=cleanHeader"/>
</when>
<otherwise>
<log message="${file:name} is an unknown file type, sending to unhandled repo." loggingLevel="INFO" />
<to uri="{{unhandledArchive}}" />
</otherwise>
</choice>
</route>
…
诺弗林斯是一个财产
现在有一个命令,所有这一切,我发现,同时做这件事。
有关XML DSL中组件的驼峰式排序,请访问以下链接
Camel DataFormat Jackson using blueprint XML DSL throws context exception