2016-03-26 11 views
0

ファイルシステムからBeanメソッドにファイルを読み込むために、私はapache camel Fileを使用しています。私はspring xmlと一緒に使っています。私は、ルートプロセスでGenericFileProcessStrategyクラスのprepareOnStartupメソッドをオーバーライドする必要があります。 spring XMLファイルのfrom uriルート行で構文を教えてください。GenericFileProcessStrategyクラスのprepareOnStartupメソッドをオーバーライド

ばねXML:

<bean id="adoFilter" class="calypsox.bllInterfaces.cashMgn.cashMgnAdo.AdoFileFilter"/> 

<camelContext xmlns="http://camel.apache.org/schema/spring" id="cashMgn"> 

    <propertyPlaceholder id="cashMgnProperty" 
    location="${bll.resources.env}/cashMgn.properties" /> 

    <route id="cashMgnAdo"> 
     <from uri="file:{{cashMgnAdoFileDir}}?filter=#adoFilter;move=.org/${date:now:yyyyMMdd}/${file:name}&amp;readLock=changed&amp;readLockCheckInterval=2000&amp;readLockTimeout=10000&amp;moveFailed=.failed" /> 
     <convertBodyTo type="java.lang.String" /> 
     <to uri="bean:cashMgnHandler?method=handleCashMgnAdo" /> 
    </route> 

</camelContext> 

答えて

1

GenericFileProcessStrategyprocessStrategyプロパティで設定することができる。

<bean id="myProcessStrategy" class="..."/> 

.. 

<from uri="file:..?..processStrategy=#myProcessStrategy"/> 
関連する問題