Hi, I am new to Camel. What's the best approach to read one file (FileA in
example below), and only enrich it with FileB if fileB exists, otherwise
just use contents of fileA. Using XML...

        <camelContext xmlns="http://camel.apache.org/schema/spring";
autoStartup="true">
        
        <route id="readFileA" trace="true">
            <from uri="file:C:\temp?fileName=FileA.csv"/>
                        <bean ref="FileToStringList" method="read"/>
                        <bean ref="FileAToMap" method="getMappedData"/>
                        <to uri="seda:fileA"/>
        </route>  
        
        <route id="readFileB" trace="true">
             <from uri="file:C:\temp?fileName=FileB.csv"/>
                        <bean ref="FileToStringList" method="read"/>
                        <bean ref="FileBToMap" method="getMappedData"/>
                        <to uri="seda:fileB"/>
        </route>  
        
        <route id="transformSDLJob" trace="true">
            <from uri="seda:fileA"/>
                <pollEnrich uri="seda:fileB" strategyRef="AggregateMaps"
timeout="10000" />
            <bean ref="MergeMapsAandB" method="merge"/>
            <to uri="seda:C"/>
        </route>

       <route id="outSDL" trace="true">
            <from uri="seda:C"/>
            <bean ref="OutputFields" method="select"/> 
            <to
uri="file:C:\temp?fileName=fileC.csv&amp;fileExist=Override"/>
        </route> 
      
    </camelContext>



--
View this message in context: 
http://camel.465427.n5.nabble.com/Missing-source-file-tp5756234.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to