我案例
<camel:camelContext id="camel">
<camel:route>
<camel:from ref="hotfolderEndpoint"/>
<camel:to uri="file://c:/test/myfolder/toEnd"></camel:to>
</camel:route>
</camel:camelContext>
<camel:endpoint id="hotfolderEndpoint" camelContextId="camel"
uri="file://c:/test/hotfolder?move=backup/${date:now:yyyyMMdd}/${file:name}"/>
结果:org.apache.camel.component.file.GenericFileOperationFailedException:无法创建目录:c:\test\hotfolder\backup\now:yyyyMMdd\name
二、案例 DSL
from("file://c:/test/myfolder?preMove=inprogress&moveFailed=backup/${date:now:yyyyMMdd}/${file:name}")
.to("file://c:/test/myfolder/toEnd");
结果 preMove 工作正常(已创建正在进行的文件夹),但移动引发异常:GenericFileOperationFailedException:无法将文件:GenericFile[c:\test\hotfolder\xxx.txt] 重命名为:GenericFile[backup\20100512]
三、案例
<bean id="hotfolderEndpoint"
class="org.apache.camel.component.file.FileEndpoint"
factory-bean="camel"
factory-method="getEndpoint">
<constructor-arg ref="hotfolder" />
<property name="readLock" value="rename" />
<property name="move" ref="moveExp"/>
</bean>
<bean id="moveExp" class="org.apache.camel.model.language.SimpleExpression">
<property name="expression" value="done/${file:name.noext}-done.${file:ext}"/>
</bean>
与案例 II 类似的问题
四、案例
<camel:camelContext id="camel">
<camel:route>
<camel:from uri="file://c:/test/hotfolder?move=backup/${date:now:yyyyMMdd}/${file:name}"/>
<camel:to uri="file://c:/test/myfolder/toEnd"></camel:to>
</camel:route>
</camel:camelContext>
结果:按预期工作
问题:我做错了什么还是骆驼有错误