Re: File consumer - waiting for it to start

2012-02-03 Thread Babak Vahdat
t your JVM exits at the end! You can take a look at [1] to see how you can keep your Camel standalone application running. [1] http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html Babak -- View this message in context: http://camel.465427.n5.nabble.com/File-consumer-w

Re: File consumer - waiting for it to start

2012-02-03 Thread Hadrian Zbarcea
://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5455435.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Hadrian Zbarcea Principal Software Architect Talend, Inc http://coders.talend.com/ http://camelbot.blogspot.com/

Re: File consumer - waiting for it to start

2012-02-03 Thread Larry Meadors
On Fri, Feb 3, 2012 at 5:04 PM, Hadrian Zbarcea wrote: > Babak's link should help. That is useful mostly when you run manually using > something like camel:run. Another option is to wait for an event after > context.start() and at the end of your processing trigger the event. That > way your wait

Re: File consumer - waiting for it to start

2012-02-04 Thread Babak Vahdat
;re no more files to consume inside the Processor. [1] http://camel.apache.org/file2.html [2] http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html Babak -- View this message in context: http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5455909.html

Re: File consumer - waiting for it to start

2012-02-04 Thread Babak Vahdat
context: http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5456068.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File consumer - waiting for it to start

2012-02-04 Thread Babak Vahdat
: http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5456174.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File consumer - waiting for it to start

2012-02-04 Thread Larry Meadors
On Sat, Feb 4, 2012 at 6:49 AM, Babak Vahdat wrote: > Of course the best way to verify it, is to use Camel test toolkit [1] and > check if it does functionally what you expect it to do. Thanks - that's a great idea - I've got a unit test for it, but how can I simulate onCompletion from it? I'm ex

Re: File consumer - waiting for it to start

2012-02-04 Thread Babak Vahdat
Make use of template.requestBodyAndHeaders() instead of template.sendBodyAndHeaders(). Babak -- View this message in context: http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5456440.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File consumer - waiting for it to start

2012-02-04 Thread Larry Meadors
Same result - works with the sleep; fails without it...which seems odd - I wonder if it's a result of using the onCompletion() stuff to shut things down. I added some logging to see what's happening. Without the sleep call it looks like this: [thread #0] INFO 2012-02-04 10:43:16,646: shutting d

Re: File consumer - waiting for it to start

2012-02-04 Thread Babak Vahdat
//camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5456788.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File consumer - waiting for it to start

2012-02-05 Thread Claus Ibsen
Hi The FAQ http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html We should probably add a note to that given FAQ, that stopping a route from a route is further complicated if you use the current thread doing so. Its best practice to just flip a flag or some sort of signals that the rou

Re: File consumer - waiting for it to start

2012-02-05 Thread Babak Vahdat
d X times a hard-coded value of 1 then we should better return 0 instead to signal there's no real inflight exchange available. Babak -- View this message in context: http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5458048.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File consumer - waiting for it to start

2012-02-05 Thread Claus Ibsen
s a hard-coded value of 1 then we should better return 0 instead to > signal there's no real inflight exchange available. > > Babak > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p54580

Re: File consumer - waiting for it to start

2012-02-05 Thread Claus Ibsen
main.stop() (as by the upper example) did *not* behave like >> this! >> >> A possible fix (may be dirty) would be to check that if we already returned >> X times a hard-coded value of 1 then we should better return 0 instead to >> signal there&#x

Re: File consumer - waiting for it to start

2012-02-05 Thread Claus Ibsen
code. So when we look at it again in 1+ years we know why the hack is there. > > Babak > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5458048.html > Sent from the Camel - Users mailing list arc

Re: File consumer - waiting for it to start

2012-02-06 Thread Babak Vahdat
.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5459995.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File consumer - waiting for it to start

2012-02-06 Thread Bilgin Ibryam
gt;> >>> it waits and waits until the (30 seconds) timeout reaches although no *real* >>> inflight exchanges are available at all! I realized this behavior as I was >>> trying to provide a working example for the user (you see already by this >>> thread). &g

Re: File consumer - waiting for it to start

2012-02-06 Thread Babak Vahdat
-consumer-waiting-for-it-to-start-tp5455062p5461593.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File consumer - waiting for it to start

2012-02-06 Thread Larry Meadors
Wow, this thread is growing and what I thought was a simple task is turning into a bit of a mess. :-/ Here's what I'm trying to accomplish: - I have a directory with files in it - I want to process every file in that directory - Once I have processed *all* of the files, I want my app to execute

Re: File consumer - waiting for it to start

2012-02-06 Thread Larry Meadors
Just had a thought - couldn't I use the file component as a batch consumer, then know when it had consumed all of the files and trigger my cleanup code based on that, then have that trigger the shutdown? Not at my computer at the moment, I'll have to try it in the morning. Larry On Feb 6, 2012 4:

Re: File consumer - waiting for it to start

2012-02-06 Thread Claus Ibsen
On Tue, Feb 7, 2012 at 4:41 AM, Larry Meadors wrote: > Just had a thought - couldn't I use the file component as a batch consumer, > then know when it had consumed all of the files and trigger my cleanup code > based on that, then have that trigger the shutdown? > Yes the file consumer is a batch

Re: File consumer - waiting for it to start

2012-02-06 Thread Claus Ibsen
l > The dynamic page works https://cwiki.apache.org/confluence/display/CAMEL/How+can+I+stop+a+route+from+a+route I will kick a manual export to see if that fixes the static page. > Babak > > -- > View this message in context: > http://camel.465427.n5.nabble.com/File-consumer-wa

Re: File consumer - waiting for it to start

2012-02-06 Thread Babak Vahdat
is message in context: http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5462431.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File consumer - waiting for it to start

2012-02-07 Thread Larry Meadors
You're the man, Claus. ;-) I added a "direct:stop" route to my builder with the cleanup and shutdown code in it. I changed my route to send a message to it using "onCompletion().onWhen(header(Exchange.BATCH_COMPLETE).isEqualTo(true))", and blammo! It all works exactly how I wanted it to. Amazin