camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: Cycle polling
Date Tue, 29 May 2012 12:22:11 GMT
Sounds like a good case for the dynamic router:
http://camel.apache.org/dynamic-router.html

In the expression you could test if the result is ok and return null if 
it is ok. As long as it is not ok you would return the endpoint uri of 
the second service.
If the expression is too complicated you can use a bean for it.

Like:

from("direct:beginPollQ").dynamicRouter(bean(new MyResultChecker("restlet://secondService"))).to("direct:result");



Christian


Am 29.05.2012 13:49, schrieb Henryk Konsek:
>>   from("direct:sendQ").to("restlet://firstService").to("direct:beginPollQ");
>>   from("direct:beginPollQ").delay().to("restlet://secondService")
>>                              .choice().
>>                                           when(IS_OK).to("direct:result").
>>                               .otherwise().to("direct:beginPollQ")
>>
>> But I think is too ugly.
> Do you? :) I personally think that it's pretty valid solution for the
> problem you described.
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Mime
View raw message