Hi Have you seen this unit test which uses a custom comparator https://svn.apache.org/repos/asf/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRemoteFileSorterTest.java
On Tue, Aug 30, 2011 at 3:25 PM, Sorin Silaghi <sorin7...@gmail.com> wrote: > Hi all, > > > We wrote a read lock strategy that allows us to use multiple > FTP consumers for the same directory. The problem we are facing now is that > when using multiple consumers they all go for the same file in the list. To > solve this we would need FTP consumers to go after a random file from the > directory. > > I wrote a Comparator that returns a random value and I thought > we could use it to sort the file list. I know it's not the most elegant > solution but it works fine with Collections.sort(). The problem is Camel > doesn't seem to use it. It doesn't even pick it up actually. > > My question is what would be the best way to do this (any > other suggestions besides the random comparator) and anybody has any idea > why this wouldn't work? > > > Sorin. > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/