Pacemaker:Java
When Camel Smiles
OREST IVASIV
1/18/2015 @halyph
Pacemaker:Java
Integration concept
Camel Intro
Sample route
Camel community
1/18/2015 @halyph2
Agenda
Pacemaker:Java
1/18/2015 @halyph3
What is Apache Camel?
Apache Camel ™ is a versatile open-source integration framework based on
known Enterprise Integration Patterns.
Is not ESB (Servicemix, Mule)
Is not Message Broker (ActiveMQ, RabbitMQ)
Is not a runtime container (see Tomcat)
Pacemaker:Java
1. Enterprise integration—how to integrate independent applications so that they can work
together.
2. An enterprise application often incorporates an n-tier architecture enabling it to be
distributed across several computers.
3. Q: Why is an n-tier architecture considered application distribution and not application
integration?
◦ the communicating parts are tightly coupled
◦ communication between tiers tends to be synchronous
4. Communication between tiers tends to be synchronous
1/18/2015 @halyph4
Distributed Applications vs. Integration
Pacemaker:Java
1/18/2015 @halyph5
Complexity of Integration
No Tool
Integration
Framework
Enterprise
Service Bus
Integration Suite
Low High
Connectivity
Routing
Transformation
Integration
Tooling
Monitoring
Support
Business Process Management
Big Data / MDM
Registry / Repository
Rule Engine
“You Name It”
Custom
integration
Pacemaker:Java
1/18/2015 @halyph6
Message
Pacemaker:Java
1/18/2015 @halyph7
Exchange
Pacemaker:Java
1/18/2015 @halyph8
CamelContext
Pacemaker:Java
1/18/2015 @halyph9
Camel Architecture
Pacemaker:Java
General use
 Direct, seda, file, bean, log, timer
Search, big data, cashing
 Lucene, solr, elasticsearch
 Hdfs, s3, mongodb
 Ehcache, hazelcast
Management
 Jmx, ldap, splunk, zookeeper
Integration
 http, servlet, cxf, jms
protocols
 Mina, netty, pop3, imap
1/18/2015 @halyph10
Component Categories
Pacemaker:Java
1/18/2015 @halyph11
ls camel/components
Pacemaker:Java
• You found a component… now what?
◦ Review the spec page, samples, unit tests
◦ Include camel-[component] jar in your project
◦ Add dependency to your pom.xml
◦ w/o maven (gradle) just add your jars to your classpath
◦ Create a basic unit test
◦ Copy/paste from component test
◦ Sanity test your setup
◦ Validate desired config option
◦ Integrate your component with your app
◦ Is you CamelContent setup?
◦ Is your RouteBuilder wired in?
1/18/2015 @halyph12
How to use a component
Pacemaker:Java
1/18/2015 @halyph13
Sample Route
Pacemaker:Java
1/18/2015 @halyph14
Sample Route (cont.)
Pacemaker:Java
1/18/2015 @halyph15
Top Camel contributors
$ git shortlog -ns
8095 Claus Ibsen
2853 Willem Ning Jiang
1385 James Strachan
930 Willem Jiang
757 Hadrian Zbarcea
648 Babak Vahdat
487 Christian Mueller
478 Jonathan Anstey
196 cmueller
194 Hiram R. Chirino
143 Christian Schneider
139 Henryk Konsek
136 Daniel Kulp
130 Moulliard Charles
108 Gert Vanthienen
100 Dhiraj Bokde
Pacemaker:Java
Author: James Strachan <jstrachan@apache.org> 2007-03-19 12:54:57
1/18/2015 @halyph16
Camel initial commit
`
Apache ActiveMQ
Apache Camel
Apache ServiceMix
Groovy programming language
Pacemaker:Java
1/18/2015 @halyph17
Books
Pacemaker:Java
• Camel One 2011-2013 (http://camelone.org)
• DevNation 2014 (http://www.devnation.org)
1/18/2015 @halyph18
Conferences
Pacemaker:Java
Q&A
1/18/2015 @halyph19

When Camel Smiles

Editor's Notes

  • #5 http://www.eaipatterns.com/Introduction.html Distributed Applications vs. Integration This book is about enterprise integration—how to integrate independent applications so that they can work together. An enterprise application often incorporates an n-tier architecture (a more sophisticated version of a client/server architecture) enabling it to be distributed across several computers. Even though this results in processes on different machines communicating with each other, this is application distribution, not application integration. Why is an n-tier architecture considered application distribution and not application integration? First, the communicating parts are tightly coupled—they dependent directly on each other, so that one tier cannot function without the others. Second, communication between tiers tends to be synchronous. Third, an application (n-tier or atomic) tends to have human users that will only accept rapid system response. In contrast, integrated applications are independent applications that can each run by itself, but coordinate with each other in a loosely coupled way. This enables each application to focus on one comprehensive set of functionality and yet delegate to other applications for related functionality. Integrated applications communicating asynchronously don’t have to wait for a response; they can proceed without a response or perform other tasks concurrently until the response is available. Integrated applications tend to have a broad time constraint, such that they can work on other tasks until a result becomes available, and therefore are more patient than most human users waiting real-time for a result.
  • #6 http://www.kai-waehner.de/blog/2011/06/02/when-to-use-apache-camel/ http://www.slideshare.net/KaiWaehner/spoilt-for-choice-how-to-choose-the If you have to integrate just one or two technologies, e.g. reading a file or sending a JMS message, it is probably much easier and faster to use some well known libraries such as Apache Commons IO or Spring JmsTemplate. But please do always use these helper classes, pure File or JMS integration with try-catch-error is soooo ugly!
  • #7 $ ls -d */ | wc -l 187
  • #8 MEPs are used to differentiate between one-way and request-response messaging styles. The Camel exchange holds a pattern property that can be either
  • #9 From book “Camel in Action”
  • #13 http://www.consulting-notes.com/2014/06/apachecon-2014-presentation-apache.html#comment-form
  • #18 http://camel.apache.org/books.html Camel in Action Apache Camel Developer's Cookbook Instant Apache Camel Message Routing Instant Apache Camel Messaging System Enterprise Integration Patterns Apache Camel Developer's Cookbook by Scott Cranton and Jakub Korab (Packt Publishing, December 2013) Instant Apache Camel Messaging System by Evgeniy Sharapov (Packt Publishing, September 2013) Instant Apache Camel Message Routing by Bilgin Ibryam (Packt Publishing, August 2013) Camel in Action by Claus Ibsen and Jonathan Anstey (Manning, December 2010) Enterprise Integration Patterns by Gregor Hohpe and Bobby Woolf (Addison Wesley, October 2003)