2013-06-04 35 views
0

我試圖用駱駝FTP組件來獲得從遠程FTP服務器的文件。我正在用藍圖來開發我的例子。與藍圖駱駝FTP組件的運行總是

如果我實現了作爲在成分(http://camel.apache.org/ftp.html)的主頁的例子,我有沒有問題。

我的問題是,當我只能用這個組件作爲comsumer它總是聽遠程目錄。

(<從URI = 「SFTP:// @測試// REMOTESERVER變種的/ opt /測試密碼=祕密」/>)。

我想要做的事情是用seda觸發這條路線,一次運行後,它應該將文件導入本地目錄,然後繼續執行下面的路由(它通常不會因爲路由中的雙重路由而工作) )。

<?xml version="1.0" encoding="UTF-8"?> 

http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprinthttp://camel.apache.org/schema/blueprint/camel-blueprint.xsd「>

<camelContext id="blueprintContext" trace="false" 
    xmlns="http://camel.apache.org/schema/blueprint"> 
    <route id="source_quartz"> 
     <from 
      uri="quartz://myGroup/myTimerName?trigger.repeatInterval=10000&amp;trigger.repeatCount=0" /> 
     <to uri="seda:step1" /> 
    </route> 

    <route id="ftp_ruote"> 
     <from uri="seda:step1" /> 
     <from uri="sftp://[email protected]//var/opt/test?password=secret"/> 
     <to uri="file:///local/test" /> 
     <to uri="seda:step2" /> 
    </route> 
    . 
    . 
    . 
</camelContext> 

回答

0

看看路由策略,這使得你的路線與如石英路由策略,在那裏你可以開始配置關聯|。停止區間時的路線應積極

請參閱以下鏈接。那麼你只需要1路:

+0

謝謝您的回答。因爲我是駱駝新人,可能有我無法得到的東西。我正在使用ftp從遠程服務器獲取文件。我的問題是,當我用ftp作爲comsumer,它總是聽的目錄,我需要做的事情是一樣的ssh和解析及布拉布拉一些處理之後,觸發該FTP路線。我不想讓ftp總是聽目錄。我只想當我觸發它並且只運行一次ftp然後繼續下一個路由時才能得到文件。 (基本上我想用ftp組件作爲製作人,但是我無法以這種方式找到一個例子,我希望我現在更清楚) – tace