是否有骆驼while循环? [英] Is there a while loop in Camel?

查看:274
本文介绍了是否有骆驼while循环?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有骆驼while循环的想法?
我们使用的是骆驼做批处理(不是一个真正的ESB我知道的职权范围)。我想继续检查对别的东西的状态,而我处理的ESB消息。我只能找到一个循环环路,用于一个定义的次数,即,用于测试或将检查每x秒的石英计时器。这些都不是真正合适的。

Is there an idea of a while loop in Camel? We are using Camel for doing batch processing (not really the remit of an ESB I know). I want to keep checking on the status of something else whilst I am processing messages in the ESB. I can only find a loop that loops for a defined number of times, i.e. for testing or a quartz timer that will check every x seconds. Neither of these are really suitable.

任何建议,还是我要求的东西简单地之外的ESB?

Any suggestions, or am I asking for something simply outside of the remit of an ESB?

推荐答案

这样做这样的事情是什么:

What about doing something like this:

<camelContext id="myContext">
    <route id ="initializer">
        <!--This will be created only once -->
        <from uri="timer://foo?repeatCount=1"/>
        <to uri="seda:mySedaQueue"/>
    </route>

    <route id ="myRoute">
        <from uri="seda:mySedaQueue"/>
        <choice>
            <when>
                <simple>{your condition if you want to continue}</simple>
                ...
                <to uri="seda:mySedaQueue" />
            </when>
            <otherwise>
                ...
            </otherwise>
        </choice>
    </route>
</camelContext>

这篇关于是否有骆驼while循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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