Hi Xavier,

I suspect camel did the right thing. Camel waits for in-flight messages to 
complete [1].
I don't know how you set up your routes, but I suspect that you stop the 
consumer in one of the steps while there are still messages to consume. Since 
the consumer didn't grab them yet, and hence they are not in flight camel 
continues and shuts down normally.

Since this scenario is about correlation of activities, I believe BAM is your 
best bet. JMX would work too, would take more effort to implement I think.
For your first question, how can you know that the input was fully treated, 
that's applications specific. Camel cannot know what your input is and when it 
finishes, it only consumes what's available. Therefore you'll need to check 
some condition before you stop camel. In essence it's what you do with your 
Thread.sleep in an indirect way, you are checking if enough time passed since 
you started to accept input. Since the check is not explicit, but somewhat 
implicit, you ensure the condition is met by using the sleep.

Cheers,
Hadrian



[1] http://camel.apache.org/graceful-shutdown.html


On Feb 7, 2011, at 11:56 AM, Xavier Coulon wrote:

> 
> Hello,
> 
> I'm currently evaluating Camel for Data Integration purpose. So far, it
> works very well, but I'm facing the following issue in my test case : when
> dealing with a (not so) large file (5k lines), the Camel Context is shutdown
> before all lines are processed, and some assertions
> (MockEndpoint.expectedMessageCount()) fail. Still, I can by-pass this issue
> by adding a Thread.sleep() in my test and get the expected result. (Unless
> there 's some better way to proceed ?)
> 
> Now, in a context of ETL, the first step would be loading data into a
> staging database with Camel, and *then* (2nd step) perform some business
> controls before publishing in production (3rd step). 
> My question is : how can I detect that the initial/input file was fully
> treated (end of 1st step) before starting the business controls ? 
> Would you recommend using JMX or BAM ? Or can a listener be notified when
> some queue was idle for a given time ?
> 
> Thank you in advance
> Regards,
> Xavier
> -- 
> View this message in context: 
> http://camel.465427.n5.nabble.com/ETL-how-to-monitor-the-end-of-processing-tp3374562p3374562.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to