Camel-拆分列表<myobj>并处理每个java对象 - XML Config </myobj>

时间:2013-08-21 18:40:28

标签: apache-camel

我无法拆分列表中的Java对象。我如何将Body标记/转换为单个java对象?

    <route id="cleanupMigratedFiles" autoStartup="true">

        <from uri="timer://kickoff?period=5s" />
        <bean ref="migrationProcessor" method="getCacheDeleteObjects" /> <!--  this gives me a List-of-CacheMigr -->
        <log message="\n\t########\n\tCleanupMigrated file: ${body}" />
        <pipeline>
            <split>
                <tokenize /> <!-- How to tokenize a List-of-CacheMigr  -->
                <convertBodyTo type="era.oddw.entity.CacheMigr" /> <!-- Do I need this? -->
                <log message="\n\t########\n\tCleanupMigrated file: ${body}" />
            </split>
        </pipeline>
    </route>

1 个答案:

答案 0 :(得分:10)

在更多阅读之后找到答案。以下标记标记为正确列出:$ {body}

感谢Camel家伙。

        <split streaming="true">
            <simple>${body}</simple>
            <convertBodyTo type="era.oddw.entity.CacheMigr" /> 
            <log message="\n\t########\n\tCleanupMigrated file each: ${body}" />
        </split>