骆驼执行终点和路线

Camel perform endpoint & route

我想扫描带子文件夹的文件夹,这是我的配置

Source

-- Center_A

  -- Target

-- Center_B

  -- Target
.....

我的问题:

  1. 如何扫描Source/Center*(没有子文件夹目标)

  2. 如何将在 Source/Center_A 中扫描的文件传送到 Source/Center_A/Target 并在 Source/Center_B/Target

  3. 中路由 Source/Center_B

我的骆驼-context.xml

    <endpoint id="dossierin" uri="file:Source/Center*" />

     <route>
        <from ref="dossierin" />
        <to uri="${file:dossierin}/Target" />
    </route>

编辑 1:

第一期已修复

<endpoint id="dossierin" uri="file:Source?recursive=true&amp;maxDepth=1"/>

编辑 2:

第二期已修复

<camelContext id="camelCtx" xmlns="http://camel.apache.org/schema/spring">
    <endpoint id="repoOutA" uri="file:work/outA" />
    <route>
        <from uri="file:Source?recursive=true&amp;maxDepth=2&amp;move=Target" />
        <to ref="repoOutA"/>
    </route>
</camelContext>

最后一个问题,移动选项足够我不想使用

  <to ...>

这可能吗?

1) 文件组件允许配置最小和最大深度,您可以使用它们来限制仅向下扫描 2 层深度(1=基本目录,2=第一个子目录)。并设置递归=真。

查看文档:http://camel.apache.org/file2

2) 不明白你的问题。