camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen">
Subject HEADS UP - File and FTP - Exclusive read lock
Date Tue, 29 Jul 2008 07:43:13 GMT

I had this mail on my todo, so after my 2nd cup of Coffee and before wrestling the WAS beast
I might get this todo crossed of the list.

CAMEL-760 and CAMEL-654 is about the file and ftp producers should not consume files that
are in progress of being written.

So I did get a go on these and had my fun with the Bamboo server as well that got me side
kicked for 3+ hours. So mail elsewhere.

Basically I added FileLock capabilities to the file component so I will wait to acquire the
"rw" lock before consuming. 

And for the FTP component we don't have such a FTP operation so the strategy is to try to
rename the file before consuming. Waiting until the rename is possible. 

However unit testing this is not easy as apparently it works on a win XP box but not on Bamboo.
Well it was not supposed to work, since the FileLock can't be used as a kind of "monitor"
for shared files in the same JVM. And as the unit test is running in a single JVM we can't
do this easily.

Anyway the new options is disabled by default, but I feel that if we get these verified by
either creating a smarter unit tests or manually testing with 2 JVM's etc. then I would like
to let these options be the default for the future.

I am not to keen that Camel will consume files that is currently being written and we end
up with only part of the data.

And I have named the option: consumer.exclusiveRead. Anyone got a better name?

BBTW: The consumer. prefix is starting to irritate me as the options on the URIs is getting
very long. Maybe something to look at in Camel 2.0.

Any thoughts.

Med venlig hilsen

Claus Ibsen
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576

View raw message