camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <ch0...@gmail.com>
Subject Re: File content missing in Copied File using Camel XML DSL
Date Fri, 25 Apr 2014 14:09:32 GMT
I have created a unit test and the tests succeeded

import org.apache.camel.Exchange;
import org.apache.camel.impl.JndiRegistry;
import org.apache.camel.test.junit4.LanguageTestSupport;
import org.junit.Test;

public class SimpleLanguageTest extends LanguageTestSupport {

    @Test
    public void testWithTilde() throws Exception {

exchange.getIn().setBody("1~pass=jayanta~oprncode=ATM~custno=4990000001");
        assertPredicate("${in.body} contains 'ATM'", true);
    }

    @Test
    public void testWithTildeAndEqual() throws Exception {

exchange.getIn().setBody("1~pass=jayanta~oprncode=ATM~custno=4990000001");
        assertPredicate("${in.body} contains 'oprncode=ATM'", true);
    }

    protected String getLanguageName() {
        return "simple";
    }

}


On Fri, Apr 25, 2014 at 3:25 PM, j_pramanik_ind
<jayanta.pramanik@gmail.com>wrote:

> Hi Claus,
>
> My Camel version is 2.10. I have set streamCache="true" in <camelContext
> ...>.
>
>  My objective is to check incoming file content for a specific parameter in
> the content string and accordingly I need to copy original source file to
> output folder.
>
> Two output folders are there : 'atm' and 'neft'
> Common receiving folder is : 'received'
>
> Previously I used <split> and <tokenize> tags but it did not work properly
> for me.
> I just removed <split> tag along with  <tokenize token="~" /> but I can not
> even print log message after checking condition with <when> .
>
> Now the XML route looks like below -
>
> <route id="route1">
>                         <from
> uri="file:E:\\bankappfiles\\received?delete=true" />
>                         <log message="Title Name [${body}]" />
>
>
>                                 <choice>
>                                         <when>
>                                                 <simple> ${in.body}
> contains 'oprncode=ATM'</simple>
>                                                 <log message="=========>>
> ATM [${in.body}]" />
>                                                 <to
> uri="file:E:\\bankappfiles\\atm?noop=true" />
>                                         </when>
>                                         <when>
>                                                 <simple>${in.body}
> contains 'oprncode=NEFT'</simple>
>                                                 <log message="=========>>
> NEFT [${in.body}]" />
>                                                  <to
> uri="file:E:\\bankappfiles\\neft?noop=true" />
>                                         </when>
>                                 </choice>
>
>                 </route>
>
>
> Please help me regarding this issue as no concrete example and documents
> not
> available for specific problem to resolve.
>
> Thanks in advance.
>
> Jayanta P.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/File-content-missing-in-Copied-File-using-Camel-XML-DSL-tp5750582p5750613.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message