3

I'm probrably missing something, but here is what's happening.

This works: I have two files on the todo folder. If I create this route everything works fine, I received the two exchanges, one for each file, every 30 seconds:

    from(String.format(baseFtpConnectionString, "/todo/") + "&scheduler=quartz2&scheduler.cron=0/10+*+*+*+*+?")
    .to("log:test?showAll=true&multiline=true")
    .unmarshal(bindyRegister)
    .process(new Processor() {                  
      @Override
      public void process(Exchange exchange) throws Exception {
          System.out.println("Ok");            
      }
    })
    .end();  

The problem: But, if I create this route, one exchange is received every 30 seconds, switching between the two files.

  from("quartz2://getData?cron=0/10+*+*+*+*+?")
  .pollEnrich(String.format(baseFtpConnectionString, "/todo/"))
  .to("log:test?showAll=true&multiline=true")
  .unmarshal(bindyRegister)
  .process(new Processor() {                  
    @Override
    public void process(Exchange exchange) throws Exception {
        System.out.println("Ok");            
    }
  })
  .end(); 

The ftp url in the baseFtpConnectionString is something like this after the String.format:

ftps://user@path:port/path?password=password&passiveMode=true

Why the pollEnrich do not send me the two exchanges? It was not suppose to have the same behavior as a from statement?

EDIT 1

Is there a way to do that using poolEnrich (Recieve all the exchanges, for both files) ?

EDIT 2

Apparently there is not. So, is there any other way to load all files from a ftp component that began on a direct component, besides the one on the link?

Will Glück
  • 1,242
  • 12
  • 17
  • 1
    If you want to use cron scheduling then you can do that directly on the ftp endpoint also - http://www.davsclaus.com/2013/08/apache-camel-212-even-easier-cron.html - then you do not need any pollEnrich – Claus Ibsen May 14 '16 at 10:28
  • I think I can't do that. I need to do three ftp calls, so I'm putting then on a direct. After each call I call the processor. Its a pipeline that is started with quartz2. If I started with a ftp scheduler, where I will put the other calls to ftp? How can I organize that? – Will Glück May 16 '16 at 11:45
  • I do not think anybody understand what you are talking about. SO is not a chat forum. You asked a question and you got an answer. Do not keep on asking new questions in the same question! – Claus Ibsen May 16 '16 at 14:33
  • Sorry about that. I'm really lost on the documentation. I will try to read a book about camel and create a better question if I got stuck again. Thanks for the help. – Will Glück May 16 '16 at 14:57

1 Answers1

4

No its not to be the same.

A poll enrich is only enriching for one message at a time.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65