Hi leNerd,
I solved this by adding a pollStrategy to the file:
from("file:target/input/?pollStrategy=#pollStrategy&delay=10000")
from("quartz:yourSchedule")
.bean("pollStrategy")
public class FilePollStrategy implements PollingConsumerPollStrategy {
@Override
public boolean begin(Consumer consumer, Endpoint endpoint) {
return poll.get();
}
...
@Handler
public void allowPolling(Exchange exchange){
poll.set(true);
}
}
Hope this helps,
Mitko
From:
Claus Ibsen <[email protected]>
To:
[email protected]
Date:
11.07.2011 14:51
Subject:
Re: Scheduled Polling Consumer on FTP endpoint
On Mon, Jul 11, 2011 at 10:58 AM, lunchbox <[email protected]>
wrote:
> Hi all,
>
> I'm having the exact same problem as leNerd explains in the OP, except
I'm
> enriching from a JMS queue instead of a FTP server. Basically, I want
ALL
> the queued messages instead of just one.
>
You can use a java bean / Camel Processor and then do a loop to drain
the message queue.
> What's the situation and the recommended solution with Camel now?
>
> If we go with Willem's idea of starting and stopping a Camel route, how
long
> should we let it run? I think in my use case, we could have a few ten
> messages in the queue at the most. How should we schedule the route
stopping
> -- with another quartz timer, or just sleep in the route starting
thread, or
> something else?
>
> As background, the JMS queue is a temporary resend queue for messages
which
> have been processed for their content successfully, but have failed to
be
> sent over SOAP to another server (network interruptions etc). We store
them
> in the JMS queue and periodically attempt to resend (all of) them.
>
> Thanks,
> Lunchbox
>
> --
> View this message in context:
http://camel.465427.n5.nabble.com/Scheduled-Polling-Consumer-on-FTP-endpoint-tp472602p4574353.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
InterComponentWare AG:
Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler
Aufsichtsratsvors.: Prof. Dr. Christof Hettich
Firmensitz: 69190 Walldorf, Altrottstraße 31
AG Mannheim HRB 351761 / USt.-IdNr.: DE 198388516