camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Wait for condition
Date Tue, 21 Oct 2008 08:24:21 GMT
2008/10/20 Ovidius <ovidiu.ariton@gmail.com>:
>
> Hi ,
>
>  I was a little evasive. I describe here the entire situation:
>
>     I Receive several messages in an endpoint. At some moment i have to
> suspend processing of messages (I do not know for how long so I can not use
> a delay which have to a specific duration) until it fulfills an external
> condition. When this condition fulfills i need to resume the processing of
> messages. During the  message processing is suspended other messages can
> arrive in the endpoind.

Another option is to add a bean processor into the route which can
implement the delay.

e.g.

from("seda:foo").bean(SomeClass.class).to("seda:output");

Then in your bean evaluate your specific condition and block until the
condition is met (either by checking the condition and then sleeping
and re-evaluating, or hopefully using some neater java.util.concurrent
mechanism to know when the condition is now met).

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Mime
View raw message