Apache Camel is versatile integration library that supports a huge number of components, enterprise integration patterns, and programming languages.
In this this talk I first introduce you to Apache Camel and its concepts. Then we move on to see how you can use the Groovy programming language with Camel as a first class Groovy DSL to build integration flows.
You will also learn how to build a new Camel and Groovy app from scratch from a live demo.
And we also touch how you can use Camel from grails using the grails-camel plugin.
I will also show the web console tools that give you insight into your running Apache Camel applications, including visual route diagrams with tracing, debugging, and profiling capabilities.
This session will be taught with a 50/50 mix of slides and live demos, and it will conclude with Q&A time.
2. PUBLIC PRESENTATION | CLAUS IBSEN2
Your Speaker
● Principal Software Engineer at Red Hat
● Apache Camel
● 6 years as committer
● Author of Camel in Action book
● Contact
● EMail: claus.ibsen@gmail.com
● Twitter: @davsclaus
● Blog: http://davsclaus.com
● Linkedin: http://www.linkedin.com/in/davsclaus
12. PUBLIC PRESENTATION | CLAUS IBSEN12
What is Apache Camel?
● Why do we need integration?
● Critical for your business to integrate
● Why Integration Framework?
● Framework do the heavy lifting
● You can focus on business problem
● Not "reinventing the wheel"
13. PUBLIC PRESENTATION | CLAUS IBSEN13
What is Apache Camel?
● What is Enterprise Integration Patterns?
It's a book
14. PUBLIC PRESENTATION | CLAUS IBSEN14
What is Apache Camel?
● Enterprise Integration Patterns
http://camel.apache.org/eip
15. PUBLIC PRESENTATION | CLAUS IBSEN15
What is Apache Camel?
● EIP - Content Based Router
18. PUBLIC PRESENTATION | CLAUS IBSEN18
What is Apache Camel?
from newOrder
choice
when isWidget to widget
19. PUBLIC PRESENTATION | CLAUS IBSEN19
What is Apache Camel?
from newOrder
choice
when isWidget to widget
otherwise to gadget
20. PUBLIC PRESENTATION | CLAUS IBSEN20
What is Apache Camel?
from(newOrder)
choice
when(isWidget) to(widget)
otherwise to(gadget)
21. PUBLIC PRESENTATION | CLAUS IBSEN21
What is Apache Camel?
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget);
22. PUBLIC PRESENTATION | CLAUS IBSEN22
What is Apache Camel?
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget);
Ups Sorry ...
This is a gr8conf
so lets get Groovy :)
23. PUBLIC PRESENTATION | CLAUS IBSEN23
What is Apache Camel?
from newOrder
choice
when isWidget to widget
otherwise to gadget
24. PUBLIC PRESENTATION | CLAUS IBSEN24
What is Apache Camel?
from newOrder
choice
when isWidget to widget
otherwise to gadget
Unfortunately the Camel
Groovy DSL is not as
awesome …
yet
25. PUBLIC PRESENTATION | CLAUS IBSEN25
What is Apache Camel?
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget)
We removed that last semi colon ;)
26. PUBLIC PRESENTATION | CLAUS IBSEN26
What is Apache Camel?
Endpoint newOrder = endpoint("activemq:queue:newOrder");
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget);
27. PUBLIC PRESENTATION | CLAUS IBSEN27
What is Apache Camel?
Endpoint newOrder = endpoint("activemq:queue:newOrder");
Predicate isWidget = xpath("/order/product = 'widget'");
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget);
41. PUBLIC PRESENTATION | CLAUS IBSEN41
What is Apache Camel?
● Summary
● Integration Framework
● Enterprise Integration Patterns (EIP)
● Routing (using DSL)
● Easy Configuration (endpoint as uri's)
● Just Java, XML, or Groovy code
● No Container Dependency
● A lot of components
42. PUBLIC PRESENTATION | CLAUS IBSEN42
Agenda
● What is Apache Camel?
● A little Example
● Riding Camel
● Creating new Camel Projects
● hawtio
● Q & A
50. PUBLIC PRESENTATION | CLAUS IBSEN50
A Little Groovy Example
● Run the example
● groovy mycamel.groovy
51. PUBLIC PRESENTATION | CLAUS IBSEN51
Agenda
● What is Apache Camel?
● A little Example
● Riding Camel
● Creating new Camel Projects
● hawtio
● Q & A
53. PUBLIC PRESENTATION | CLAUS IBSEN53
Riding Camel
● Using Command Shell
● Requires: Apache Maven
● From Eclipse
54. PUBLIC PRESENTATION | CLAUS IBSEN54
Riding Camel
● Console Example
● cd examples/camel-example-console
● mvn compile exec:java
55. PUBLIC PRESENTATION | CLAUS IBSEN55
Riding Camel
● Twitter Example
● cd examples/camel-example-twitter-websocket
● mvn compile exec:java http://localhost:9090/index.html
56. PUBLIC PRESENTATION | CLAUS IBSEN56
Riding Camel
● More examples ...
... and further details at website.
http://camel.apache.org/examples
57. PUBLIC PRESENTATION | CLAUS IBSEN57
Agenda
● What is Apache Camel?
● A little Example
● Riding Camel
● Creating new Camel Projects
● hawtio
● Q & A
58. PUBLIC PRESENTATION | CLAUS IBSEN58
Creating new Camel Projects
● Using Command Shell
● .. or from Eclipse
59. PUBLIC PRESENTATION | CLAUS IBSEN59
Creating new Camel Projects
● Importing into Eclipse
Existing Maven Project
61. PUBLIC PRESENTATION | CLAUS IBSEN61
Creating new Camel Projects
● camel-archetype-groovy
mvn install
mvn exec:java
62. PUBLIC PRESENTATION | CLAUS IBSEN62
Creating new Camel Projects
● camel-archetype-spring
mvn install
mvn camel:run
mvn io.hawt:hawtio-maven-plugin:1.4.2:spring
63. PUBLIC PRESENTATION | CLAUS IBSEN63
Agenda
● What is Apache Camel?
● A little Example
● Riding Camel
● Creating new Camel Projects
● hawtio
● Q & A
70. PUBLIC PRESENTATION | CLAUS IBSEN70
Agenda
● What is Apache Camel?
● A little Example
● Riding Camel
● Creating new Camel Projects
● hawtio
● Q & A