Hi,

I think I understand what you mean, but still the context still seems to be
shut down.
Can you please give me some more tips here?

Here is my code:

public void transferFilesToFtp(final String ftpLocation) throws Exception {
  final CamelContext context = new DefaultCamelContext();
  context.addRoutes(new RouteBuilder() {
    @Override
        public void configure() {
          from("file://outbox").routeId("ftp")
                .errorHandler(deadLetterChannel("direct:error"))
                .log("Going to FTP!").to(ftpLocation)
                .log("Files transferred!")
               .process(new Processor() {
                        public void process(Exchange exchange)
                                        throws Exception {
                                boolean isLast = 
exchange.getProperty(Exchange.BATCH_COMPLETE,
                                Boolean.class);
                                                                
                                if (isLast) {
                                        System.err.println("Stop!!!");
                                        
context.getInflightRepository().remove(exchange);
                                        context.stopRoute("ftp");
                               }
                        } } );
                                
                from("direct:error").log("Error occured during FTP").to(
                                                "file://errorbox");
                }
                });
                context.start();
                // FIXME
                Thread.sleep(1000);
//              context.stop();
        }



--
View this message in context: 
http://camel.465427.n5.nabble.com/Do-i-need-to-wait-for-endpoint-ftp-to-finish-tp4994642p4997391.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to