You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Kai Wähner <me...@googlemail.com> on 2012/02/17 07:18:33 UTC

Problem with Splitter EIP (after changing from Camel 2.6 to 2.9)

Hello.

I have got an working example in Camel 2.6. I upgraded to Camel 2.9, now
the example fails.
The Splitter does not work anymore. I tried for two hours now, but I do not
understand what changed or how to fix it.

Here is the route. Input body is for example:
"kai 1 / dvd , kai 2 / cd , kai 3 / book"


        from("file:orders/inbox?noop=
true")

            .tracing()

            .process(new LoggingProcessor())

            .bean(new TransformationBean(), "makeUpperCase")

            .unmarshal().csv()


            // working in 2.6, but not in 2.9 ??? (I used the default
tokenizer, a comma, there.
            .split().body()

// I tried with Camel 2.9 for example:
            //.split(body(String.class).tokenize(","))
            //.split(body().tokenize(","))
// this way it splits again, BUT:
// the first order contains a "[[", the last order contains a "]]". What is
happening and why?


            // Content-based Router EIP
            //.log("Kai: ${body}")
            .choice()
                .when(body().contains("DVD"))
                    // Producer Endpoint
                    .to("file:orders/outbox/dvd")
                .when(body().contains("CD"))
                    .to("file:orders/outbox/cd")
                .otherwise()
                    .to("mock:others");

Can please anyone help me solve it (and explain what happened / changed
between 2.6 and 2.9)?
Thank you a lot...

Best regards,
Kai

Re: Problem with Splitter EIP (after changing from Camel 2.6 to 2.9)

Posted by megachucky <me...@googlemail.com>.
Ok, thx. I concentrated on the Splitter instead of looking at the csv, too.

My csv example is a one liner, therefore in Camel 2.6 it did not return a
List. 

I was not aware of this change in Camel 2.9 - I had to change the example
code a little bit. Unfortunately, it is a little bit more code now. But I
think the decision for this change makes sense.

--
View this message in context: http://camel.465427.n5.nabble.com/Problem-with-Splitter-EIP-after-changing-from-Camel-2-6-to-2-9-tp5491598p5502451.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem with Splitter EIP (after changing from Camel 2.6 to 2.9)

Posted by Claus Ibsen <cl...@gmail.com>.
Can you paste the content of your CSV file?


The CSV data format now always returns a List if its 0, 1, or 2+ rows,
as stated in the release notes
http://camel.apache.org/camel-290-release.html



On Fri, Feb 17, 2012 at 7:18 AM, Kai Wähner <me...@googlemail.com> wrote:
> Hello.
>
> I have got an working example in Camel 2.6. I upgraded to Camel 2.9, now
> the example fails.
> The Splitter does not work anymore. I tried for two hours now, but I do not
> understand what changed or how to fix it.
>
> Here is the route. Input body is for example:
> "kai 1 / dvd , kai 2 / cd , kai 3 / book"
>
>
>        from("file:orders/inbox?noop=
> true")
>
>            .tracing()
>
>            .process(new LoggingProcessor())
>
>            .bean(new TransformationBean(), "makeUpperCase")
>
>            .unmarshal().csv()
>
>
>            // working in 2.6, but not in 2.9 ??? (I used the default
> tokenizer, a comma, there.
>            .split().body()
>
> // I tried with Camel 2.9 for example:
>            //.split(body(String.class).tokenize(","))
>            //.split(body().tokenize(","))
> // this way it splits again, BUT:
> // the first order contains a "[[", the last order contains a "]]". What is
> happening and why?
>
>
>            // Content-based Router EIP
>            //.log("Kai: ${body}")
>            .choice()
>                .when(body().contains("DVD"))
>                    // Producer Endpoint
>                    .to("file:orders/outbox/dvd")
>                .when(body().contains("CD"))
>                    .to("file:orders/outbox/cd")
>                .otherwise()
>                    .to("mock:others");
>
> Can please anyone help me solve it (and explain what happened / changed
> between 2.6 and 2.9)?
> Thank you a lot...
>
> Best regards,
> Kai



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/