Apache Camel by Claus Ibsen A Progress Software Company

Apache Camel
by Claus Ibsen
A Progress Software Company
1
Copyright © 2010 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









2
Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Who is Claus Ibsen?
 Principal Software Engineer at FuseSource
• Full time Apache Camel hacker
 Apache Camel committer for 3 years
• Camel Project Lead
• 3.5 years working with Camel
 Author of Camel in Action book
 Contact
• Twitter: @davsclaus
• Blog: http://davsclaus.blogspot.com
• Email: cibsen@fusesource.com
http://www.manning.com/ibsen
3
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
My Employer
 FuseSource - http://fusesource.com
4
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Why the name Camel?
 What does Camel stand for?
Concise
Application
Messaging
Exchange
Language
http://camel.apache.org/why-the-name-camel.html
5
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Why the name Camel?
 The reason for the Camel name
Camel is easy to remember and
type
http://camel.apache.org/why-the-name-camel.html
6
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









7
Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
The birth of Apache Camel
 Camel’s parents
8
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
The birth of Apache Camel
 Initial Commit Log
r519901 | jstrachan | 2007-03-19 11:54:57 +0100
(Mon, 19 Mar 2007) | 1 line
Initial checkin of Camel routing library
 Apache Camel 1.0 released June 2007
9
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
The birth of Apache Camel
 My initial commit
r640963 | davsclaus | 2008-03-25 21:07:10 +0100
(Tue, 25 Mar 2008) | 1 line
Added unit test for mistyped URI
10
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









11
Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Quote from the web site
• http://camel.apache.org
Apache Camel is a
powerful Open Source
Integration Framework
based on known
Enterprise Integration Patterns
12
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Why do we need integration?
• Your apps are build using different tech stacks
• Critical for your business to integrate
 Why Integration Framework?
• Framework do the heavy lifting
• Focus on business problem
• Not "reinventing the wheel"
13
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 What is Enterprise Integration Patterns?
14
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 What is Enterprise Integration Patterns?
15
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 What is Enterprise Integration Patterns?
Its a book
16
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Use Case
Apache
ActiveMQ
17
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
WebSphereMQ
A Progress Software Company
What is Apache Camel
 Filter Pattern
18
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Filter Pattern
from
A
19
filter
message
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
send to
B
A Progress Software Company
What is Apache Camel
 Filter Pattern
from(A)
20
filter(predicate)
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
to(B)
A Progress Software Company
What is Apache Camel
 Filter Pattern
from(A)
21
.filter(isWidget)
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
.to(B)
A Progress Software Company
What is Apache Camel
 Filter Route
from(A).filter(isWidget).to(B)
;
22
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Filter Route
isWidget = xpath("/quote/product = ‘widget’");
from(A).filter(isWidget).to(B);
23
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Filter Route
Endpoint A = endpoint("activemq:queue:quote");
Endpoint B = endpoint("mq:quote");
Predicate isWidget = xpath("/quote/product = ‘widget’");
from(A).filter(isWidget).to(B);
24
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Filter Route
public void configure() throws Exception {
Endpoint A = endpoint("activemq:queue:quote");
Endpoint B = endpoint("mq:quote");
Predicate isWidget = xpath("/quote/product = ‘widget’");
from(A).filter(isWidget).to(B);
}
25
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Filter Route - Java DSL
import org.apache.camel.builder.RouteBuilder;
public class FilterRoute extends RouteBuilder {
public void configure() throws Exception {
Endpoint A = endpoint("activemq:queue:quote");
Endpoint B = endpoint("mq:quote");
Predicate isWidget = xpath("/quote/product = ‘widget’");
from(A).filter(isWidget).to(B);
}
}
26
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Filter Route - Java DSL
import org.apache.camel.builder.RouteBuilder;
public class FilterRoute extends RouteBuilder {
public void configure() throws Exception {
from("activemq:queue:quote")
.filter().xpath("/quote/product =‘widget’")
.to("mq:quote");
}
}
27
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
28
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 IDE Tooling
29
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Lets look at the most famous pattern
30
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Content Based Router
31
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Content Based Router - XML DSL
<camelContext>
<route>
<from uri="activemq:NewOrders"/>
<choice>
<when>
<xpath>/order/product = 'widget'</xpath>
<to uri="activemq:Orders.Widgets"/>
</when>
<otherwise>
<to uri="activemq:Orders.Gadgets"/>
</otherwise>
</choice>
</route>
</camelContext>
32
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Content Based Router - Java DSL
from("activemq:NewOrders")
.choice()
.when().xpath("/order/product = 'widget'")
.to("activemq:Orders.Widget")
.otherwise()
.to("activemq:Orders.Gadget");
33
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Endpoints as URIs
use file instead
from("file:inbox/orders")
.choice()
.when().xpath("/order/product = 'widget'")
.to("activemq:Orders.Widget")
.otherwise()
.to("activemq:Orders.Gadget");
34
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Endpoints as URIs
parameters
from("file:inbox/orders?delete=true")
.choice()
.when().xpath("/order/product = 'widget'")
.to("activemq:Orders.Widget")
.otherwise()
.to("activemq:Orders.Gadget");
35
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Summary
•
•
•
•
•
•
•
•
•
•
•
•
36
Integration framework
Enterprise Integration Patterns (EIP)
Routing and mediation
Domain Specific Language (DSL)
Endpoints as URIs
Predicate and Expressions
Very extensible and configurable
No heavy specification
No container dependency
Payload agnostic
Connectivity to a great wealth of transports
Apache licensed
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
What is Apache Camel
 Mission Statement
Making integration easier
and more accessible to
developers
37
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









38
Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
A little example
 Based on community user (Gunnar Hillert)
• http://hillert.blogspot.com/2009/09/camellos-discovering-apache-camelii.html
 Goals
•
•
•
•
•
39
1) Pickup files from a directory
2) Make sure we only pickup 3 files per 30 seconds
3) Store into JMS queue
4) Listen on JMS queue
5) And upload file to FTP server
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
A little example
 Goals using Enterprise Integration Patterns
1
2
3
4
5
 Goals
• 1) Pickup files from a directory
• 2) Make sure we only pickup 3 files per 30 seconds
• 3) Store into JMS queue
• 4) Listen on JMS queue
• 5) And upload file to FTP server
40
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
A little example
 Goals using Enterprise Integration Patterns
from
throttle
to
from
to
 Goals
• 1) Pickup files from a directory
• 2) Make sure we only pickup 3 files per 30 seconds
• 3) Store into JMS queue
• 4) Listen on JMS queue
• 5) And upload file to FTP server
41
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
A little example
 Camel Route in XML DSL
<camelContext>
<route>
<from uri="file:camellos/inbox?move=.done"/>
<throttle maximumRequestsPerPeriod="3"
timePeriodMillis="30000”>
<to uri="activemq:queue:camellos"/>
</throttle>
</route>
<route>
<from uri="activemq:queue:camellos"/>
<to uri="ftp://admin:secret@localhost:3333"/>
</route>
</camelContext>
42
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









43
Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Highlights of whats included in Camel
44
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 50 Enterprise Integration Patterns
http://camel.apache.org/eip
45
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 80 Components
activemq
cxf
flatpack
jasypt
activemq-journal
cxfrs
freemarker
javaspace
amqp
dataset
ftp/ftps/sftp
jbi
atom
db4o
gae
jcr
bean
direct
hdfs
jdbc
bean validation
ejb
hibernate
jetty
browse
esper
hl7
jms
cache
event
http
jmx
cometd
exec
ibatis
jpa
crypto
file
irc
jt/400
http://camel.apache.org/components.html
46
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 80 Components
language
properties
seda
stream
ldap
quartz
servlet
string-template
mail/imap/pop3
quickfix
sip
test
mina
ref
smooks
timer
mock
restlet
smpp
validation
msv
rmi
snmp
velocity
nagios
rnc
spring-integration
vm
netty
rng
spring-security
xmpp
nmr
rss
spring-ws
xquery
printer
scalate
sql
xslt
http://camel.apache.org/components.html
47
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 19 Data Formats
bindy
castor
csv
crypto
dozer
flatpack
gzip
hl7
jaxb
json
protobuf
serialization
soap
syslog
tidy markup
xml beans
xml security
xstream
zip
http://camel.apache.org/data-format.html
48
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Data Format
from("activemq:QueueWithJavaObjects”)
.marshal().jaxb()
.to("mq:QueueWithXmlMessages");
49
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 15 Expression Languages
BeanShell
Python
EL
Ruby
Groovy
Simple
JavaScript
SpEL
JSR 223
SQL
OGNL
XPath
MVEL
XQuery
PHP
http://camel.apache.org/languages.html
50
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 DSL in multiple flavors
Java
from(A).filter(isWidget).to(B);
<route>
<from ref="A"/>
<filter>
<xpath>/quote/product = ‘widget’</xpath>
<to ref="B"/>
</filter>
</route>
Scala
from(A) filter(isWidget) --> B
51
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Type Converters
INFO DefaultTypeConverter
- Loaded 148 type converters
52
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Custom Type Converters
@Converter
public class MyTypeConverter {
@Converter
public String toString(MyOrder order) {
StringBuilder sb = new StringBuilder();
...
return sb.toString();
}
}
# META-INF/services/org/apache/camel/TypeConverter
com.acme.converters
53
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Powerful bean integration
• Adapt to your beans
• Message Translator EIP
• EIP as @annotations
– @Produce
– @Consume
– @RecipientList
– @RoutingSlip
– @DynamicRouter
54
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Bean as Message Translator
55
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Bean as Message Translator
from("activemq:Incoming”).
beanRef("myBeanName", "someMethod").
to("activemq:Outgoing");
public class Foo {
public String someMethod(String name) {
return “Hello “ + name;
}
}
56
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Bean Parameter Binding
public class Foo {
public
String
processOrder(
String
orderAsXml,
@XPath("/order/@id")
String oid,
@Header("JMSCorrelationID")
String cid) {
...
}
}
57
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Sending message
public
class Foo {
@Produce(uri="activemq:foo")
ProducerTemplate producer;
public
void doSomething()
{
if producer.sendBody("<hello>world!</hello>");
(whatever)
{
}
}
}
58
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Sending message, hiding Camel
public interface Echo {
String hello(String name);
}
public class Foo {
@Produce(uri="activemq:foo")
Echo echo;
public void doSomething() {
if (whatever) {
String reply = echo.hello("Camel");
}
}
}
59
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Receiving message
public class Foo {
@Consume(uri="activemq:cheese")
public
void onCheese(String name) {
...
}
}
60
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Test Kit
•
•
•
•
•
•
61
camel-test JAR
JUnit based
TestNG supported in next release
Supports Spring
Easy to test
Quick prototyping
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Testing Using Mocks
Figure from Camel in Action book published by Manning
62
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Test Kit from IDE
63
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Managed
• JMX API
• REST API
64
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Developer Web Console
65
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Fuse IDE
66
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Error Handling
• Errors happen
X
67
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Error Handling
• Try ... Catch style
from("activemq:incoming")
.doTry()
.marshal().jaxb()
.to("mq:QueueWithXmlMessages")
.doCatch(Exception.class)
.to("activemq:error")
.end();
68
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Error Handling
• Dead Letter Channel EIP
errorHandler(
deadLetterChannel("activemq:error")
);
from("activemq:incoming")
.marshal().jaxb()
.to("mq:QueueWithXmlMessages");
69
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Error Handling
• Dead Letter Channel EIP w/ Redelivery
errorHandler(
deadLetterChannel("activemq:error")
.maximumRedeliveries(5)
.redeliveryDelay(5000)
);
from("activemq:incoming")
.marshal().jaxb()
.to("mq:QueueWithXmlMessages");
70
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Other Features
•
•
•
•
Interceptors
Transaction
Compensation
Pluggable Security Framework
– Apache Shiro
– Spring Security
•
•
•
•
71
Event Notification
Route Policy
Thread Model
Asynchronous Non-Blocking Routing Engine
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Whats included in the box?
 Summary
•
•
•
•
•
•
•
•
•
•
•
•
72
50 EIP patterns
80 Components
19 Data formats
15 Expression Languages
DSL in multiple flavors (Java, XML, Scala, Groovy)
Automatic type conversion
Strong bean support
Test Kit
Management (JMX, REST)
Developer Web Console
Error Handling
Non-blocking Routing Engine
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









73
Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Running Camel
 Riding the Camel
74
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Running Camel
 Deployment Strategy
• No container dependency
• Lightweight
• Embedable
 Deployment Options
• Standalone
• WAR
• Spring
• J2EE
• JBI
• OSGi
• Cloud
75
• Java
Web
Start
Copyright ©
2011 Progress
Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
Known Containers
Apache ServiceMix
Apache ActiveMQ
Apache Tomcat
Jetty
JBoss
IBM WebSphere
Oracle WebLogic
Oracle OC4j
Glassfish
Google App Engine
... others
A Progress Software Company
Running Camel
 Java Application
CamelContext context = new DefaultCamelContext();
context.addRoutes(new MyRouteBuilder());
context.start();
 Java Client Application
CamelContext context = new DefaultCamelContext();
context.start();
ProducerTemplate producer = context.createProducerTemplate();
...
String xml = ...
...
producer.sendBody("ftp:someserver?username=foo"
+ "&password=secret&filename=myfile.xml", xml);
76
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Running Camel
 Spring Application
<beans xmlns="http://www.springframework.org/schema/beans">
<camelContext xmlns="http://camel.apache.org/schema/spring">
<package>com.mycompany.routes</package>
</camelContext>
</beans>
 OSGi Blueprint Application
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<package>com.mycompany.routes</package>
</camelContext>
</blueprint>
77
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









78
Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Another Example
 A More Complex Example
 Goals
•
•
•
•
•
79
1) Pickup order files
2) Split file into order lines
3) Normalize and process each order line
4) Assemble order summary
5) Send order summary to topic
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Yet Another Example
Composed Message Processor
Polling
Consumer
1
Splitter
2
Normalizer
Service
Activator
3
Aggregator
4
Endpoint
5
 Goals
•
•
•
•
•
80
1) Pickup order files
2) Split file into order lines
3) Normalize and process each order line
4) Assemble order summary
5) Send order summary to topic
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Yet Another Example
 Camel Route in XML DSL
<camelContext>
<route>
<from uri="file:inbox?move=.done"/>
1
</route>
</camelContext>
81
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Yet Another Example
 Camel Route in XML DSL
<camelContext>
<route>
<from uri="file:inbox?move=.done"/>
<split>
<xpath>/order/line</xpath>
2
</split>
</route>
</camelContext>
82
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Yet Another Example
 Camel Route in XML DSL
<camelContext>
<route>
<from uri="file:inbox?move=.done"/>
<split>
<xpath>/order/line</xpath>
<marshal><jaxb contextPath="com.foo"/></marshal>
3
</split>
</route>
</camelContext>
83
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Yet Another Example
 Camel Route in XML DSL
<camelContext>
<route>
<from uri="file:inbox?move=.done"/>
<split>
<xpath>/order/line</xpath>
<marshal><jaxb contextPath="com.foo"/></marshal>
<bean ref="orderLineService"/>
</split>
3
</route>
</camelContext>
<bean id="orderLineService" class="com.foo..."/>
84
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
3
A Progress Software Company
Yet Another Example
 Camel Route in XML DSL
<camelContext>
<route>
4
<from uri="file:inbox?move=.done"/>
<split strategyRef="summaryService">
<xpath>/order/line</xpath>
<marshal><jaxb contextPath="com.foo"/></marshal>
<bean ref="orderLineService"/>
</split>
</route>
</camelContext>
<bean id="orderLineService" class="com.foo..."/>
<bean id="summaryService" class="com.foo..."/>
85
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
4
A Progress Software Company
Yet Another Example
 SummaryService
4
public class SummaryService implements
AggregationStrategy {
Exchange aggregate(Exchange oldExchange,
Exchange newExchange) {
...
}
}
86
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Yet Another Example
 Camel Route in XML DSL
<camelContext>
<route>
<from uri="file:inbox?move=.done"/>
<split strategyRef="summaryService">
<xpath>/order/line</xpath>
<marshal><jaxb contextPath="com.foo"/></marshal>
<bean ref="orderLineService"/>
5
</split>
<to uri="jms:topic:order.summary"/>
</route>
</camelContext>
<bean id="orderLineService" class="com.foo..."/>
<bean id="summaryService" class="com.foo..."/>
87
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Yet Another Example
 Camel Route in Java DSL
from("file:inbox?move=.done")
.split()
.xpath("/order/line")
.aggregationStrategyRef("summaryService")
.marshal().jaxb("com.foo")
.beanRef("orderLineService")
.end()
.to("jms:topic:order.summary");
88
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Yet Another Example
 Camel Route in Java DSL
from("file:inbox?move=.done")
.split().streaming().parallelProcessing()
.xpath("/order/line")
.aggregationStrategyRef("summaryService")
.to("bean:orderLineService")
.end()
.to("jms:topic:order.summary");




89
Enabling streaming
Process each line concurrently
Infer JAXB marshalling
Using bean as endpoint
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









90
Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
The Camel Web Site
•About 193.000 visitors in 2009
91
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
The Camel Web Site
•About 280.000 visitors in 2010
92
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
The Camel Web Site
•About 70.000 visitors from 1st Jan 2011 - 7th Mar 2011
93
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
The Camel Web Site Growth
44%
39%
2009
2010
2011
(193K)
(277K)
(384K*)
100%
94
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
Camel User Mailing List
95
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
Camel Team
•25 committers
• of which 12 has done 50+ commits
•Commits mailing list
96
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
Camel Committers Top 10
•
3872 Claus Ibsen 2002 Willem Ning Jiang 1316 James Strachan 468
Hadrian Zbarcea 365 Jonathan Anstey 194 Hiram R. Chirino 105 Gert
Vanthienen 90 William Tam 81 Guillaume Nodet 68 Moulliard Charles
8810 Commits
97
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
Issue Tracker
98
Total
3767
Resolved
3574
Open
193
Bugs
5 (3% of open)
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
Release Schedule
99
Release
Date
Tickets
Camel 2.0
Aug 2009
760
Camel 2.1
Dec 2009
303
Camel 2.2
Feb 2010
180
Camel 2.3
May 2010
273
Camel 2.4
July 2010
182
Camel 2.5
Oct 2010
300
Camel 2.6
Jan 2011
297
Camel 2.7
Mar 2011
171
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
•Community Contributions to Apache Camel 2.xAbout 25
component out of 51
•8 data formats out of 12
•1 language out of 3
•3 examples out of 20
100
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
•3rd party Camel projectsGithub
•
115 Camel repositories (About 80% is Apache Camel based)
•Google Code
• About 10 Camel related projects
•FuseForge (http://fusesource.com/forge)
• About 8 Camel related projects
101
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
•3rd party integrating CamelApache ActiveMQ / Fuse Broker
•Apache ServiceMix / Fuse ESB
•JBoss ESB
•JBoss Drools
•JOnAs Application Server
•OpenESB
•Progress Sonic ESB
•Activiti
•Akka / Scalaz
102
JBoss ESB 4.9 : Support for Apache Camel
IMHO, this is the greatest improvement in JBoss
ESB from the last 3 years
by Edgar Silva, JBoss, nov 2010
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Camel Community
•3rd party integrating Camel (cont.)Open eHealth Integration
Platform
•Apache Hise
•Apache James
•Catify
•Dozer
•TouK
•Grails Plugin
•Play Framework
•Scalete
•Smooks
See more: http://camel.apache.org/user-stories.html
103
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Agenda









Who is Claus Ibsen?
The birth of Apache Camel
What is Apache Camel?
A little example
Whats included in the box?
Running Camel
Another Example
The Camel Community
Q and A
104
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Q and A
 Where do I get more information?
Apache Camel Website
http://camel.apache.org
105
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Q and A
 Where do I get more information?
Join the Mailinglist
http://camel.apache.org/mailing-lists.html
Try the IRC-room
http://camel.apache.org/irc-room.html
Use the Search Box
Checkout the Camel Articles
http://camel.apache.org/articles.html
Run Camel Examples
http://camel.apache.org/examples.html
106
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Q and A
 Where do I get more information?
Camel in Action book: http://manning.com/ibsen
40% Discount Code
Use coupon code
camel40
when ordering from
Manning
107
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company
Q and A
108
Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
A Progress Software Company