Apache Camel Was Awesome from v1.0 Onward
Join the DZone community and get the full member experience.Join For Free
|Apache Camel 1.0 - 5 years ago|
The more I looked the more impressed I was with the first release. Now you have to consider this was done 5 years ago, and in this release the Camel founders had already established these features in the DNA of the project:
- Java DSL
- XML DSL (using Spring)
- OSGi on the roadmap
- camel-core JAR of 660kb
- 18 external components (+ whats in camel-core)
- 2 working examples
- full website with documentation included, incl FAQs
- Project logo and box
- The Camel Maven plugin to easily run Camel and its examples
- Test Kit
|Camel 1.0 distribution (hint the OSGi ambitions in the pom.xml)|
When you hear James talk about the past and how he created Camel, his ambition was that Camel should not restrain you. If you want to use Java and not XML then fine. If you are on the Spring XML bandwagon, then fine. If you are into Groovy, then fine, if you want to use Ruby, then hell yeah (Ruby support was added in Camel 1.3).
|Java DSL in Camel 1.0|
And a sample of the XML DSL, which you can see in the source code as well.
|XML DSL in Camel 1.0|
|Camel Test Kit already in Camel 1.0|
And notice from the unit test above, the reference to the founders of Apache Camel.
- James Strachan
- Rob Davies
- Hiram Chirino
- Guillaume Nodet
Thanks guys for creating this marvelous project. Impressive first release from 5 years ago.
$cd examples $cd camel-example-spring $mvn compile $mvn camel:run
|Camel 1.0 example running|
The screenshot above shows the Camel 1.0 example running. This example kicks off by consuming messages from a JMS queue and writes those to a file. So we need to connect with jconsole, to send a message. I have highlighted the service url to use in jconsole.
|jconsole to send a message - Camel 1.0 rocks|
In jconsole we expand the tree and find the test queue, and invoke the sentTextMessage operation with the text "Camel 1.0 rocks".
- Adjust the pom.xml to use Camel 2.9 - 2.10 and the camel-activemq component has been moved from Camel to ActiveMQ so you need to include that. And for logging we now use slf4j. The modified pom.xml is shown below
|Upgrading the example from Camel 1.0 to 2.9.2, adjusting the pom.xml file|
- In the Spring XML file you need to change the namespace of Camel, as when Camel graduated to become an Apache Top Level Project, the namespace was migrated from activemq to camel. Also we upgrade to use Spring 3.0 in the XSD. And the activemq component is now from ActiveMQ and not Camel. The packages attribute is now an xml tag, so you need to use <packlage> in the <camelContext>. The updated file is shown below:
|Upgrading Spring XML from Camel 1.0 to Camel 2.9.2|
|The example migrated from Camel 1.0 to 2.9.2 without any Java code changes!!!|
Published at DZone with permission of Claus Ibsen, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.