camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: random sort in FTP pooling
Date Tue, 30 Aug 2011 13:51:35 GMT

Have you seen this unit test which uses a custom comparator

On Tue, Aug 30, 2011 at 3:25 PM, Sorin Silaghi <> 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
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message