简体   繁体   English

Camel Spring DSL无法正常工作

[英]Camel Spring DSL is not working as expected

Tried to create a very simple route to read from a FTP location using Java as well as Spring DSLs. 试图创建一个非常简单的路由,以使用Java以及Spring DSL从FTP位置读取数据。

The route created with Java DSL is working as expected. 使用Java DSL创建的路由按预期工作。

from("{{ftp.server}}").to("file:target/download").log(
            "Downloaded file ${file:name} complete.");

Options: 选项:

ftp://x.x.x.x:21/in?username=kallada&password=kallada&passiveMode=false&localWorkDirectory=/tmp&delay=5s&move=done

But the route created with Spring DSL is just exiting just after logging in to the FTP server. 但是,使用Spring DSL创建的路由仅在登录FTP服务器后退出。

<route id="ftpSend">
    <from uri="ftp://kallada@x.x.x.x:21/in?password=kallada&amp;passiveMode=false&amp;binary=true&amp;delay=6000&amp;localWorkDirectory=/tmp"/> 
    <to uri="file://target/download"/> 
</route>

I'm using a locally installed FTP server (FileZilla) to test this application. 我正在使用本地安装的FTP服务器(FileZilla)测试该应用程序。 Afs ter invoking the route created with the Spring DSL the program is just exiting. 之后,调用Spring DSL创建的路由后,程序将刚刚退出。 Please see the console log attached. 请参阅附带的控制台日志。

05:06:04.402 INFO  [main][org.apache.camel.impl.converter.DefaultTypeConverter] Loaded 176 type converters
05:06:04.896 INFO  [main][org.apache.camel.spring.SpringCamelContext] StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
05:06:05.156 INFO  [main][org.apache.camel.spring.SpringCamelContext] Route: ftpSend started and consuming from: Endpoint[ftp://kallada@127.0.0.1:21/in?binary=true&delay=6000&localWorkDirectory=%2Ftmp&passiveMode=false&password=xxxxxx]
05:06:05.171 INFO  [main][org.apache.camel.spring.SpringCamelContext] Total 1 routes, of which 1 is started.
05:06:05.174 INFO  [main][org.apache.camel.spring.SpringCamelContext] Apache Camel 2.12.0 (CamelContext: camel-1) started in 1.272 seconds

Beyond this point the program just exits. 超出此点,程序将退出。

Please see the FTP server console log also. 请同时参阅FTP服务器控制台日志。

(000079)24-11-2014 05:02:45 - kallada (x.x.x.x)> 250 CWD successful. "/" is current directory.
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> PWD
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> 257 "/" is current directory.
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> CWD in
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> 250 CWD successful. "/in" is current directory.
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> PORT 127,0,0,1,251,174
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> 200 Port command successful
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> LIST
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> 150 Opening data channel for directory listing of "/in"
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> 226 Successfully transferred "/in"
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> CWD /
(000079)24-11-2014 05:02:50 - kallada (x.x.x.x)> 250 CWD successful. "/" is current directory.
(000079)24-11-2014 05:02:53 - kallada (x.x.x.x)> disconnected.

Any pointers to solve this issue would be helpful. 解决此问题的任何指示都将有所帮助。

Thanks and Regards, Santhosh 感谢和问候,桑托什

I think your main just exit after starting the camel context. 我认为您的主要角色只是在启动骆驼上下文之后退出。 Please check out this for Running Camel standalone and keeping it running. 请检查此内容以独立运行骆驼并保持运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM