On Mon, Aug 3, 2009 at 4:58 PM, Bak Attila<[email protected]> wrote:
>
> Hi,
>
> I am trying to cascade a bean and a splitter like (java DSL):
>
>        from("file:src/data?noop=true").bean(new
> IncomingMessageValidator()).
>                split().method("splitter", "splitBody").
>                to("direct:test");
>
> It complains that method to(String) is undefined for object. What am i doing
> wrong?

Its because you use split() to set the expression and then end up with
the java compiler loosing track in the fluent builder
as you end up with a method that is an expression. And then you want
to continue with a .to that is a route.

There is a limit you hit the java compiler.

You can use the parameter versions (= put stuff in a parameter to
split) then you can do what you want

        from("file:src/data?noop=true").bean(new
 IncomingMessageValidator()).
                split(method("splitter", "splitBody")).
                to("direct:test");

You may need to do an static import of the method, I cannot remember
if you got it already in the base classes for the route builders.


>
> Thanks,
> attila
> --
> View this message in context: 
> http://www.nabble.com/Cascading-bean-and-splitter-tp24792299p24792299.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to