camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sorin Silaghi <sorin7...@gmail.com>
Subject Re: random sort in FTP pooling
Date Tue, 30 Aug 2011 15:24:48 GMT
Hi,


           I did some debugging and I think I figured it out: we also
have maxMessagesPerPoll=1 set on that endpoint. This means that the consumer
generates a list of 1 elements that it then tries to sort.


           We are using maxMessagesPerPoll=1 because we have multiple routes
connected through NMR (it's all deployed in ServiceMix) and we had problems
with the FTP connector. I remember there was also a different (better)
solution but at the time we thought that this works well enough for now. I
guess it's time to revisit the old solution.


thanks,
             Sorin.


ps: should we submit a patch with this read lock strategy? We would love it
if this became part of Camel.

On Tue, Aug 30, 2011 at 4:51 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> 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 <sorin7486@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: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message