Camel internals
I'm playing with Apache Camel project and boy, it is not easy to understand it internals!
Lets see how it is initialized.
SpringCamelContext(DefaultCamelContext).doStart() line: 543
SpringCamelContext.maybeDoStart() line: 165
SpringCamelContext.doStart() line: 160
SpringCamelContext(ServiceSupport).start() line: 47
SpringCamelContext.maybeStart() line: 95
SpringCamelContext.onApplicationEvent(ApplicationEvent) line: 114
So maybeStart calls start which calls doStart which calls maybeDoStart which calls doStart.
Now question from combinatorics: how many function names can we generate from 3 words: "maybe", "do", "start" :)))
Monday, August 25, 2008
Subscribe to:
Post Comments (Atom)
2 comments:
:)
I'm not quite sure why there are so many methods. The motivations that have made it a bit more complex than it might is that
(i) we want to be able to create a Spring XML and start it, creating a CamelContext populated with all its routes but without actually starting the routes (for visualisation of EIPs and tooling etc)
(ii) we don't start the routes until the entire Spring application context has started to ensure folks don't get horrible ordering problems or have issues of routes depending on other routes and so forth
But am sure we could refactor a little to make things a bit clearer :). Contributions always welcome :)
Incidentally if you're trying to understand the internals - its probably best avoiding the Spring part and just focussing on the camel-core with the non-spring Java DSL - its much simpler. Adding in Spring along with Spring's namespace handler and JAXB gets a bit hairy at times - while the real core of Camel is pretty simple really. (The internals of the DSL can be a bit confusing - but thats DSLs for you - but the org.apache.camel.processor package is nice and simple - thats the actual implementation of all the EIPs).
Thanks for your comments James,
I have no doubts that this variety of start functions have a good reason but still looks funny :)
I'm trying to implement activemq/camel solution for a production system right now and if my project will succeed then you can expect more contribution from me :)
Post a Comment