Apache的骆驼:当选择被添加到路径路由环路丢失 [英] Apache Camel: Route loop is lost when choice is added to the path

查看:190
本文介绍了Apache的骆驼:当选择被添加到路径路由环路丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现的条件和分路器的路线。

I am trying to implement a route with conditions and splitters.

from("{{" + feed + ".downloadSource}}")
            .routeId(feed)
            .setProperty("workDirectory",simple("{{workDirectory}}"))
            .setProperty("splitSize",simple("{{" + feed + ".splitSize}}"))
            .setProperty("feedName", simple(feed))
            .setProperty("tableName",simple("{{" + feed + ".tableName}}"))
            .setProperty("options", simple("{{" + feed + ".options}}"))
            .setProperty("dateFormat", simple("{{" + feed + ".dateFormat}}"))
            .setProperty("headerFormat", simple("{{" + feed + ".headerFormat}}"))
            .setProperty("authenticateURL", simple("{{" + feed + ".authenticateURL}}"))
            .setProperty("username", simple("{{" + feed + ".username}}"))
            .setProperty("password", simple("{{" + feed + ".password}}"))
            .loop(24)
            .split(beanExpression(new APProcessor(), "getSplitProcessor"))
            .process(APProcessor.getDownloadProcessor())
            .process(APProcessor.getNamingProcessor())
            .to("{{" + feed + ".downloadDestination}}")
                            .choice()
                .when(simple("${property.CamelSplitComplete} == true"))
                .process(APProcessor.getAggregatorProcessor())
                .process(new RSProcessor())
                .endChoice();

在这条航线在APProcessor方法getSplitProcessor当我取回CamelLoopIndex则返回0每次执行。如果我删除的选择块它执行罚款。我丢失的问题。需要帮助。

When This route is executed in the APProcessor method getSplitProcessor when I retrieve the CamelLoopIndex it returns 0 everytime. If I remove the choice block it executes fine. I am missing the issue. Need help.

推荐答案

一个循环包括直到第一occurense所有操作。作为一种变通方法,你可以将所有的操作重复到一个单独的直接:路线

A loop includes all operations until the first occurense of to. As a workaround you could move all repeatable operations into a separate direct: route.

这篇关于Apache的骆驼:当选择被添加到路径路由环路丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆