Más contenido relacionado Similar a Apache Camel (20) Apache Camel2. Agenda
Who is Guillaume Nodet?
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
2 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
3. Your Presenter is: Guillaume Nodet
Software Fellow at FuseSource
http://fusesource.com
Apache Software Foundation Member, VP
Apache Karaf, PMC member of ServiceMix,
ActiveMQ, Camel, Ode, CXF, Geronimo,
Mina, Felix
Co-creator of ServiceMix, Karaf, Mina SSHD
Contact
• gnodet@fusesource.com
• gnodet@gmail.com
• http://gnodet.blogspot.com/
• http://twitter.com/gnodet
3 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
4. Agenda
Who is Guillaume Nodet?
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
4 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
5. The birth of Apache Camel
• Camel’s parents
5 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
6. 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
Apache Camel is 3 years old
6 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
7. The birth of Apache Camel
7 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
8. Agenda
Who is Guillaume Nodet?
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
8 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
9. What is Apache Camel
Quote from the web site
Apache Camel is a
Powerful Open Source
Integration Framework
based on known
Enterprise Integration Patterns
9 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
10. What is Apache Camel
What are Enterprise Integration Patterns?
10 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
11. What is Apache Camel
What are Enterprise Integration Patterns?
11 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
12. What is Apache Camel
What are Enterprise Integration Patterns?
Its a book
12 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
13. What is Apache Camel
Lets look at one of the patterns
13 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
14. What is Apache Camel
Use Case
ActiveMQ WebSphereMQ
14 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
15. What is Apache Camel
Filter Pattern
15 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
16. What is Apache Camel
Filter Pattern
from filter send to
A message B
16 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
17. What is Apache Camel
Filter Pattern
from(A) filter(predicate) to(B)
17 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
18. What is Apache Camel
Filter Pattern
from(A) .filter(isWidget) .to(B)
18 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
19. What is Apache Camel
Filter Route
from(A).filter(isWidget).to(B);
19 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
20. What is Apache Camel
Filter Route
isWidget = xpath(“/quote/product = ‘widget’”);
from(A).filter(isWidget).to(B);
20 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
21. 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);
21 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
22. What is Apache Camel
Filter Route - Java DSL
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);
}
22 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
23. What is Apache Camel
Filter Route - Java DSL
import org.apache.camel.builder.RouteBuilder;
import static org.apache.camel.builder.xml.XPathBuilder.xpath;
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);
}
}
23 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
24. 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");
}
}
24 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
25. What is Apache Camel
IDE Tooling
Code
Assistance
JavaDoc
25 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
26. What is Apache Camel
IDE Tooling
Code
Assistance
26 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
27. What is Apache Camel
Recap - Concepts of Camel
• Enterprise Integration Patterns
• Routing
• Domain Specific Language (DSL)
• Endpoints
• URIs
• Predicates & Expressions
• Components
and much more ...
Simplify Integration
27 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
28. What is Apache Camel
Lets look at the most famous pattern
28 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
29. What is Apache Camel
Content Based Router
29 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
30. What is Apache Camel
Content Based Router - Spring XML
<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>
30 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
31. What is Apache Camel
Content Based Router - Java DSL
from("activemq:NewOrders")
.choice()
.when().xpath(“/order/product = 'widget'”)
.to(“activemq:Orders.Widget”);
.otherwise()
.to(“acitvemq:Orders.Gadget”);
31 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
32. What is Apache Camel
Summary
• Camel is an integration framework
• Based on Enterprise Integration Patterns
• Routing and mediation
• Easy to use DSL to define routes
• No heavy specification
• No container dependency
• Payload agnostic
• Connectivity to a great wealth of transports
32 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
33. What is Apache Camel
Mission Statement
Making integration easier and
more accessible to developers
33 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
34. Agenda
Who is Guillaume Nodet?
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
34 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
35. A little example
Based on community user (Gunnar Hillert)
• http://hillert.blogspot.com/2009/09/camellos-discovering-apache-
camel-ii.html
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
35 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
36. 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
36 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
37. 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
37 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
38. A little example
Camel DSL in XML
<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>
38 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
39. Agenda
Who is Guillaume Nodet?
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
39 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
40. Whats included in the box?
Highlights of whats included in Camel
40 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
41. Whats included in the box?
70+ Components
activemq crypto flatpack irc ldap
activemq-journal cxf freemarker javaspace mail/imap/pop3
amqp cxfrs ftp/ftps/sftp jbi mina
atom dataset gae jcr mock
bean direct hdfs jdbc msv
bean validation esper hibernate jetty nagios
browse event hl7 jms netty
cache exec http jpa nmr
cometd file ibatis jt/400 printer
http://camel.apache.org/components.html
41 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
42. Whats included in the box?
70+ Components
properties scalate stream xslt
quartz seda string-template ejb
quickfix servlet test
ref smooks timer
restlet smpp validation
rmi snmp velocity
rnc spring-integration vm
rng spring-security xmpp
rss sql xquery
http://camel.apache.org/components.html
42 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
43. Whats included in the box?
18 Data Formats
bindy protobuf
castor serialization
csv soap
crypto tidy markup
flatpack xml beans
gzip xml security
hl7 xstream
jaxb zip
json dozer
http://camel.apache.org/data-format.html
43 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
44. Whats included in the box?
Data Format
from("activemq:QueueWithJavaObjects”)
.marshal().jaxb()
.to("mq:QueueWithXmlMessages");
44 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
45. Whats included in the box?
Predicates & Expressions
BeanShell PHP
EL Python
Groovy Ruby
JavaScript Simple
JSR 223 SQL
OGNL XPath
MVEL XQuery
http://camel.apache.org/languages.html
45 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
46. Whats included in the box?
DSL in 3 programming languages
Java
XML
from(A).filter(isWidget).to(B);
<route>
<from ref="A"/>
<filter>
<xpath>/quote/product = ‘widget’</xpath>
<to ref="B"/>
</filter>
</route>
from(A) filter(isWidget) --> B
Scala
46 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
47. Whats included in the box?
Type Converters
INFO DefaultTypeConverter
- Loaded 148 type converters
47 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
48. 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
META-INF file in the JAR
48 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
49. Whats included in the box?
Powerful bean integration
• Adapt to your beans
• EIP as @annotations
- @Produce
- @Consume
- @RecipientList
- @RoutingSlip
more to come in future releases ...
49 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
50. Whats included in the box?
Bean as Message Translator
50 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
51. 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;
}
}
51 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
52. Whats included in the box?
Bean Parameter Binding with XPath
public class Foo {
public String processOrder(
String orderAsXml,
@XPath(”/order/@id”) String oid,
@Header(”JMSCorrelationID”) String cid) {
...
}
}
52 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
53. Whats included in the box?
Sending message
public class Foo {
@Produce(uri="activemq:foo.bar")
ProducerTemplate producer;
public void doSomething() {
if (whatever) {
producer.sendBody("<hello>world!</hello>");
}
}
}
53 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
54. Whats included in the box?
The EJB MessageDrivenBean in Camel
public class Foo {
@Consume(uri="activemq:cheese")
public void onCheese(String name) {
...
}
}
54 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
55. Whats included in the box?
Test Kit
• JUnit based (3.x and 4.x)
• Supports Spring
• Easy to test
• Quick prototyping
55 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
56. Whats included in the box?
extend CamelTestSupport
Test Kit from IDE
Right Click ->
Run
Debug
Inline RouteBuilder
56 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
57. Whats included in the box?
Managed
• JMX API
• REST API
57 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
58. Whats included in the box?
Web console
• REST API
58 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
59. Whats included in the box?
Maven tooling
• Maven Archetypes to create new projects
mvn archetype:generate
-DarchetypeGroupId=org.apache.camel.archetypes
-DarchetypeArtifactId=camel-archetype-war
-DarchetypeVersion=2.4.0
• Maven goals to run project
- mvn camel:run
- mvn jetty:run
59 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
60. Whats included in the box?
Summary
• 50+ EIP patterns
• 70+ Connectivity components
• 15+ Data formats
• 10+ Languages
• DSL in multiple flavors (Java, XML, Scala, Groovy)
• Automatic type conversion
• Strong bean support
• Test Kit
• Management (JMX, REST)
• Web console
60 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
61. Agenda
Who is Guillaume Nodet?
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
61 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
62. Running Camel
Riding the Camel
62 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
63. Running Camel
Java Application
CamelContext context = new DefaultCamelContext();
context.addRoutes(new MyRouteBuilder());
context.start();
Spring Application
<camelContext>
<package>com.acme.quotes</package>
</camelContext>
63 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
64. Running Camel
Lightweight
Embeddable
Known Deployment Options
• Standalone Java Application Known Containers
• Web Application Apache ServiceMix
Apache ActiveMQ
• J2EE Application
Apache Tomcat
• JBI Jetty
• OSGi JBoss
IBM WebSphere
• Google App Engine BEA WebLogic
• Java Web Start Oracle OC4j
• Spring Application GAE
... others
64 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
65. Agenda
Who is Guillaume Nodet?
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
65 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
66. Another Example
Rider Auto Parts Example by Jonathan Anstey
http://architects.dzone.com/articles/apache-camel-integration
66 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
67. Another Example
Rider Auto Parts Example - 3 Routes
1
67 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
68. Another Example
Rider Auto Parts Example - 3 Routes
1
2
68 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
69. Another Example
Rider Auto Parts Example - 3 Routes
1
3
2
69 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
70. Another Example
Rider Auto Parts Example - 1st Route
from 1
to
public class Route1 extends RouteBuilder {
public void configure() throws Exception {
from("ftp:user@rider.com?password=secret")
.to("activemq:queue:incoming");
}
}
70 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
71. Another Example
Rider Auto Parts Example - 2nd Route
from to
2
public class Route2 extends RouteBuilder {
public void configure() throws Exception {
from("jetty:http://localhost:8080/orders")
.inOnly("activemq:queue:incoming")
.transform().constant("OK");
}
}
71 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
72. Another Example
Rider Auto Parts Example - 3rd Route
3
from to
choice
route on next slide
72 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
73. Another Example
Rider Auto Parts Example - 3rd Route
public class Route3 extends RouteBuilder {
public void configure() throws Exception {
JaxbDataFormat jaxb = new JaxbDataFormat("com.rider");
from("activemq:queue:incoming")
.convertBodyTo(String.class)
.choice()
.when().method("helper”, "isXml")
.unmarshal(jaxb)
.to("activemq:queue:order")
.when().method("helper”, "isCsv")
.unmarshal().csv()
.beanRef("orderService”, "csvToXml")
.to("activemq:queue:order")
}
}
73 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
74. Agenda
Who is Guillaume Nodet?
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
74 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
75. The Camel Community
Camel website
• 40% increase (comparing last two 6 month periods)
• Average 2200 visits per weekday (2000 - 2500)
High activity on mailing list
75 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
76. The Camel Community
20 committers
High commit activity
http://markmail.org/
76 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
77. The Camel Community
Books - Bestseller
• Manning top-15 year to date (2010)
#10 #12
77 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
78. The Camel Community
JIRA tickets
Total 3047
Open 160 (5%)
Resolved 2887 (95%)
Bugs 5 (4% open)
Oldest Bug June/29/09
Aug 12th 2010
78 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
79. The Camel Community
A lot in each new release
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
79 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
80. The Camel Community
3rd party integrating Camel
• Apache ServiceMix
• Apache ActiveMQ
• Apache James In Progress
• OpenESB • JBoss Drools
• Progress Actional Diagnostics • JBoss ESB
• FuseHQ • Smooks
• Open eHealth Integration Platform • Doozer
• Grails Camel Plugin
• Play Framework
• Akka
• Scalate
80 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
81. Agenda
Who is Guillaume Nodet?
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
81 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
82. Q and A
Where do I get more information?
- Camel website: http://camel.apache.org
- Camel article: http://architects.dzone.com/articles/apache-camel-integration
- FUSE website: http://fusesource.com
- Camel in Action book: http://manning.com/ibsen
82 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
83. Questions
83 Copyright
©
2011
Progress
So*ware
Corpora9on
and/or
its
subsidiaries
or
affiliates.
All
rights
reserved.
A
Progress
So*ware
Company
Notas del editor \n \n \n \n Camel grew out of the ServiceMix and ActiveMQ communities\n Camel added to Apache by one of its founders James Strachan. Other founders: Rob Davies, Hiram Chirino, G. Nodet\n10 Apache Camel 1.x releases\n4 Apache Camel 2.x releases\nNext -> Rob Announces Camel\n\n Next -> When I had first commit\n Next -> Quote from Website\n Next -> What is EIPs\n Next -> Story\n People discussing integration problem\nThey need a common vocabulary (language) and graphical notation\n EIP = Book\nPublished 2004\nToday = still valid\n Next -> Use Case (Filter EIP)\n Only some messages should be send.\nNext -> Filter EIP (= the pattern to use)\n Next -> Shorter notation in human readable -> turn into Java code\n \n predicate = math function outcome : true or false\nex: 2+2 = 4 ? true is the outcome\n easier to read by naming the predicate isWidget\n Can you see where we are going?\n XPath = XML Path Language = query language to select nodes and compute values (= predicate)\nNext -> Define A and B\n Next -> Put into a Java method\n Next -> Put into Class\n Camel RouteBuilder\nReal code, can compile\nNext -> Inlined URIs -> Shorter\n Next -> Tooling = Use IDE\n Code tooling = Just Java\n Next -> recap concepts we have seen\n Next -> One more pattern = The most famous\n Content Based Router = the most known/famous pattern\n \n If .. else\nChoice .. when .. otherwise\nNext -> Java DSL example\n Next -> Summary\n Next -> Mission Statement\n \n \n \n \n \n \n \n Next -> Components\n \n Next -> Data Formats\n Next -> Data Format example\n Next -> Predicates/Expressions (Languages)\n Next -> 3 DSL\n Next -> Type Converters\n Next -> Custom Type Converters\n Next -> Using Beans\n Next -> Message Translator EIP using beans\n Next -> Code how to\n Bean parameter binding (String type).\nNext -> Bean Parameter Binding with @XPath\n\n Next -> Sending message using @Produce\n Next -> Receiving message\n Next -> Test Kit\n Next -> Test Kit in IDEA\n Next -> JMX management\n Next -> Web console\n James will talk about this in his talk\nNest -> Maven tooling\n Next -> Summary\n \n \n Next -> How to in Java and Spring XML\n Next -> Deployment options\n Few dependencies\nPluggable architecture\nNext -> Agenda\n\n \n Next -> Highlight route 1\n \n \n Next -> Route 1\n \n \n \n Next -> Agenda\n \n \n \n \n \n \n Next -> Agenda -> Q&A\n \n \n \n