On Tue, Sep 14, 2010 at 3:45 PM, Andreas A. <[email protected]> wrote:
>
> Hi
>
> Ok I have corrected my flawed logic to something that works now (I never
> reached the consumer.stop() line):
>
>        public void poll() throws Exception {
>                String ftpsUri =
> "ftp:localhost:1981/inbox?username=camel&password=camel123&move=.done";
>                String fileUri = "file:{{path.out}}";
>                while(true) {
>                        Exchange ex = consumer.receive(ftpsUri, 3000);
>                        if(ex != null) {
>                                producer.send(fileUri, ex);
>                        }
>                        else if (ex == null) {
>                                consumer.stop();
>                                break;
>                        }
>                }
>        }
>
> I'm curious as to when you want to use the receiveNoWait method?

Maybe when you want to poll a message asap, and NOT wait at all. For
example from a consumer which has an queue of received messages. (eg
SEDA etc.)


> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-do-YOU-handle-scheduling-tp2838886p2839126.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to