-
1. Re: Splitter issue
davsclaus Jul 17, 2009 6:08 AM (in response to italost)Hi
The Camel Java DSL is using the fluent builder syntax where each DSL is a method call that is stacked on top on the previous.
And as such you have some limitations with the JDK itself.
The JDK is not suited for full blown DSL, e.g. building a new languages. For that we got other languages such as Groovy and Scala.
However that said its still pretty impressive what we can do with Camel in the Java DSL. It does resemble of a fullblown DSL but with limitations here and there.
Basically when you have ctrl + space to see the opertions list after type from. you get a list from the same base class (ProcessorType). It list all the possibilities you can, eg. to, splitter, aggregate, and what else.
However some of these EIP (such as splitter) have their own list of operations in their type: SplitterType. And when you get down this path the JDK cannot always "step back" so to speak.
And hence you can run into a wall with how you build the Camel routes.
-
2. Re: Splitter issue
joe.luo Jul 17, 2009 6:58 AM (in response to italost)from("cxf:someService")
.process(new MyFirstProcessor())
.splitter(true).method("someBean")
returns an Object type whileas
from("cxf:someService")
.splitter(true).method("someBean")
returns an ProcessorType type and that was why it won't compile if you continue call ".process(...)" with the former route but the later one compiles.
I suggest you to use eclipse IDE so you will be prompted with correct type when you write a complex camel route like this.
-
3. Re: Splitter issue
oisin Jul 17, 2009 9:20 AM (in response to italost)The Java fluent builder approach and the Spring XML approaches both have their advantages and drawbacks.
I took your example and sketched it out with our Integration Designer - we've just released a point upgrade to 1.2.1 - and it looks like this
which might be a big more illustrative of the route itself. The tool will allow you to run and debug your route, and export it to a Spring XML.
-
sample.png 12.9 KB
-
-
4. Re: Splitter issue
italost Jul 17, 2009 10:40 AM (in response to italost)Thanks for the answers.
I use Eclipse ide and I have noticed the type difference.
I was only wondering why and when the difference of types happens. At a first moment it sounded strange for me.
I found the Integration Designer pretty cool. I am register for the next webinar!!
Regards.
Italo Stefani
Vetta Technologies
www.vettatech.com
Edited by: italost on Jul 17, 2009 2:40 PM
-
5. Re: Splitter issue
oisin Jul 17, 2009 12:47 PM (in response to italost)I found the Integration Designer pretty cool. I am register for the next webinar!!
Thanks for the comment! I'll be doing the webinar on Tuesday 21st, currently practising my lines