Hi

Invoking start on the CamelContext is a non-blocking call, check links below
to see how to keep your standalone Camel application running:

http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html
http://stackoverflow.com/questions/1846791/camelcontext-start-doesnt-block

Babak


kalber wrote
> Hi,
> 
> i'm using the ftp server example with my server, user.. and it works.
> Below the output :
> 
> [INFO] --- exec-maven-plugin:1.1.1:java (default-cli) @ camel-example-ftp
> ---
> 2013-08-14 08:30:36,422 [tpServer.main()] INFO  MainSupport                   
> - Apache Camel 2.11.1 starting
> *********************************************************************************
> Camel will route files from the FTP server:
> ftp://xx.xx.com:21/?username=xxx&password=xxxx&delay=5s to the
> target/download directory.
> You can configure the location of the ftp server in the
> src/main/resources/ftp.properties file.
> Use ctrl + c to stop this application.
> *********************************************************************************
> 2013-08-14 08:30:36,604 [tpServer.main()] INFO  DefaultCamelContext           
> - Apache Camel 2.11.1 (CamelContext: camel-1) is starting
> 2013-08-14 08:30:36,657 [tpServer.main()] INFO  ManagementStrategyFactory     
> - JMX enabled.
> 2013-08-14 08:30:36,736 [tpServer.main()] INFO  DefaultTypeConverter          
> - Loaded 172 type converters
> 2013-08-14 08:30:36,896 [tpServer.main()] INFO  DefaultCamelContext           
> - Route: route1 started and consuming from:
> Endpoint[ftp://service.sad.it:21/?delay=5s&password=******&username=xxxx]
> 2013-08-14 08:30:36,896 [tpServer.main()] INFO 
> ultManagementLifecycleStrategy - Load performance statistics enabled.
> 2013-08-14 08:30:36,899 [tpServer.main()] INFO  DefaultCamelContext           
> - Total 1 routes, of which 1 is started.
> 2013-08-14 08:30:36,900 [tpServer.main()] INFO  DefaultCamelContext           
> - Apache Camel 2.11.1 (CamelContext: camel-1) started in 0.295 seconds
> 2013-08-14 08:30:37,921 [vice.sad.it:21/] INFO  FtpConsumer                   
> - Connected and logged in to: ftp://[email protected]:21
> 2013-08-14 08:30:38,439 [vice.sad.it:21/] INFO  route1                        
> - Downloaded file PNEUS_NUOVO.csv complete.
> 2013-08-14 08:30:38,492 [vice.sad.it:21/] INFO  route1                        
> - Downloaded file SAD_Export_20100803_3.txt complete.
> 2013-08-14 08:30:38,552 [vice.sad.it:21/] INFO  route1                        
> - Downloaded file SAD_Export_20100901_4.txt complete.
> 2013-08-14 08:30:38,577 [vice.sad.it:21/] INFO  route1                        
> - Downloaded file SAD_Export_20100901_5.txt complete.
> 
> 
> 
> Writing my own class with  CamelContext add route ( coping all from
> example )  and start context nothing happens.
> 
> CamelContext camelContext = DefaultCamelContext(jndiRegistry);
> camelContext.addRoutes(new ConfigRoutes());
> camelContext.start();
> 
> 14-08-2013 09:54:33 INFO  [main] ChangeTyreXXProcess:
> it.sad.lib.batch.ProcessHandler : started
> 14-08-2013 09:54:33 INFO  [main] ChangeTyreXXProcess: Start: 2013-08-14
> 09:54:32
> 14-08-2013 09:54:33 INFO  [main] DefaultCamelContext: Apache Camel 2.11.1
> (CamelContext: camel-1) is starting
> 14-08-2013 09:54:33 INFO  [main] ManagementStrategyFactory: JMX enabled.
> 14-08-2013 09:54:33 INFO  [main] DefaultTypeConverter: Loaded 172 type
> converters
> 14-08-2013 09:54:33 INFO  [main] DefaultCamelContext: Route: route1
> started and consuming from:
> Endpoint[ftp://service.sad.it:21/?password=******&username=xxxt]
> 14-08-2013 09:54:33 INFO  [main] DefaultManagementLifecycleStrategy: Load
> performance statistics enabled.
> 14-08-2013 09:54:33 INFO  [main] DefaultCamelContext: Total 1 routes, of
> which 1 is started.
> 14-08-2013 09:54:33 INFO  [main] DefaultCamelContext: Apache Camel 2.11.1
> (CamelContext: camel-1) started in 0.375 seconds
> 14-08-2013 09:54:33 INFO  [main] ChangeTyreXXProcess: End: 2013-08-14
> 09:54:33, elapsed seconds 1.
> 14-08-2013 09:54:33 INFO  [main] DefaultCamelContext: Apache Camel 2.11.1
> (CamelContext: camel-1) is shutting down
> 14-08-2013 09:54:33 INFO  [main] DefaultShutdownStrategy: Starting to
> graceful shutdown 1 routes (timeout 300 seconds)
> 14-08-2013 09:54:33 INFO  [Camel (camel-1) thread #2 - ShutdownTask]
> DefaultShutdownStrategy: Route: route1 shutdown complete, was consuming
> from: Endpoint[ftp://xx.xx.com:21/?password=******&username=xxx]
> 14-08-2013 09:54:33 INFO  [main] DefaultShutdownStrategy: Graceful
> shutdown of 1 routes completed in 0 seconds
> 14-08-2013 09:54:33 INFO  [main] DefaultCamelContext: Apache Camel 2.11.1
> (CamelContext: camel-1) uptime 0.385 seconds
> 14-08-2013 09:54:33 INFO  [main] DefaultCamelContext: Apache Camel 2.11.1
> (CamelContext: camel-1) is shutdown in 0.008 seconds
> 
> 
> 
> 
> Looking the example class, there is used  org.apache.camel.main.Main.
> 
> What i must do, that my class starts the download ?





--
View this message in context: 
http://camel.465427.n5.nabble.com/ftp-component-no-download-tp5737232p5737234.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to