On Mon, Feb 7, 2011 at 10:00 PM, Xavier Coulon <xcou...@gmail.com> wrote:
> Hello Hadrian,
>
> Thank you for those answers. I'll have a look at the BAM facilities provided
> by Camel. I agree that there needs to be some application-level specifics to
> implement (such as the total number of treated messages I should look at,
> including errors...)
>
> I actually agree with you that Camel just did what it had to do, except it
> seems that it shut down the file consumer before the file was actually fully
> consumed. I'll have a look at the context graceful shutdown, but I thought
> it was the default behavior in Camel 2.4 (the Fuse version I use)
>

If you use mock endpoints then they are used for testing purposes.
When the assertItSatisified() method is invoked it will timeout after
10 seconds.

So you would have to increase the timeout value using the
setResultWaitTime method.



> Regards,
> Xavier
>
> On Mon, Feb 7, 2011 at 7:47 PM, Hadrian Zbarcea <hzbar...@gmail.com> wrote:
>
>> 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.
>>
>>
>
>
> --
> Xavier
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to