Apache Camel OverviewOpen Source Integration and MessagingMarcelo JabaliSr. Solutions ConsultantDec., 2011                ...
Agenda       Apache Camel Overview       Architecture       Routes, Endpoints, Components       Deployment Options2   ...
About Me                                                                                                     Marcelo Jabal...
Apache Camel                                                                                            Apache Camel is a...
Apache Camel - Patterns     50+ Enterprise Integration Patterns                                            http://camel.a...
Apache Camel – Components, Data Formats andLanguages     80 Components (activemq, bean, cxf, file, ftp, hibernate, jdbc, ...
Apache Camel - Architecture7   Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All r...
What is a Camel Route?     A Route is the step-by-step movement of a message:       • From a “listening” endpoint in the ...
Apache Camel – DSL (Domain Specific Language)     Camel provides an embedded DSL (in Java, Spring or Scala) for      impl...
Apache Camel - Components  A Component is essentially a factory of Endpoint instances  +80 Components available         ...
Apache Camel - Endpoints  An Endpoint is an instance of the component that can   create or receive messages, for example,...
Apache Camel - Consumers and Producers  Message Consumers and Producers are created from   endpoints     • Some endpoint ...
Apache Camel - Sample Route  Typical scenario: "read an XML file from an FTP server,   process it using XSLT, and then se...
Apache Camel – Sample Route  Java DSL     from("ftp://john@localhost/ftp?password=xxx")        .to("xslt:MyTransform.xslt...
Apache Camel – Sample Route  Spring XML DSL <camelContext id=“camel”         xmlns=“http://activemq.apache.org/camel/sche...
Apache Camel – Spring Bean Integration  Spring Bean as Message Translator                   from("activemq:queue:Incoming...
Typical Camel Route Development Process  Use a Maven archetype to generate an outline project  Edit the POM to include a...
Camel Testing Options  Test Kit     •     camel-test JAR (JUnit)     •     camel-testng JAR (TestNG)     •     Supports S...
Camel Deployment Options  Deployment Strategy                                                                            ...
Thanks!No vendor lock-in    Free to redistribute         Enterprise class                                                 ...
Upcoming SlideShare
Loading in …5
×

Apache camel overview dec 2011

2,853 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,853
On SlideShare
0
From Embeds
0
Number of Embeds
440
Actions
Shares
0
Downloads
105
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Very simplified view of Camel’s architectureComponents are the extension point in Camel to add connectivity to other systems. The core of Camel is very small to keep dependencies low, promote embeddability, etc. and as a result contains only 12 essential components. There are over 60 components outside the core. To expose these systems to the rest of Camel, Components provide an Endpoint interface. By using URIs, you can send or receive messages on Endpoints in a uniform way. For instance, to receive messages from a JMS queue aQueue and send them to a file system directory &quot;c:/tmp&quot;, you could use URIs like &quot;jms:aQueue&quot; and &quot;file:c:\\tmp&quot;.Processors are used to manipulate and mediate messages in between Endpoints. All of the EIPs are defined as Processors or sets of Processors. As of writing, Camel supports 41 patterns from the EIP book, 6 other integration patterns, and many other useful Processors.To wire Processors and Endpoints together, Camel defines a Java DSL. The term DSL is used a bit loosely here as it usually implies the involvement of a compiler or interpreter that can process keywords specific to a particular domain. In Camel, DSL means a fluent Java API that contains methods named like terms from the EIP book
  • To wire processors and endpoints together to form routes, Camel defines a DSL. The term DSL is used a bit loosely here. In Camel, DSL means a fluent Java API that con- tains methods named for EIP terms.
  • Camel Demo + FUSE IDE Demo
  • Apache camel overview dec 2011

    1. 1. Apache Camel OverviewOpen Source Integration and MessagingMarcelo JabaliSr. Solutions ConsultantDec., 2011 A Progress Software Company1 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    2. 2. Agenda  Apache Camel Overview  Architecture  Routes, Endpoints, Components  Deployment Options2 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    3. 3. About Me Marcelo Jabali Sr. Solutions Consultant marcelo@fusesource.com marcelojabali.blogspot.com mjabali linkedin.com/in/jabali3 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    4. 4. Apache Camel  Apache Camel is a powerful Open Source Integration Framework based on known Enterprise Integration Patterns http://enterpriseintegrationpatterns.com/4 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    5. 5. Apache Camel - Patterns  50+ Enterprise Integration Patterns http://camel.apache.org/eip5 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    6. 6. Apache Camel – Components, Data Formats andLanguages  80 Components (activemq, bean, cxf, file, ftp, hibernate, jdbc, ibatis, jms, jetty, mina, netty, timer, xslt, etc) • http://camel.apache.org/components.html  19 Data Formats (csv, serialization, zip, hl7, soap, jaxb, etc) • http://camel.apache.org/data-format.html  15 Expression Languages (EL, Simple, XQuery, Xpath, JavaScript, Ruby, Python, PHP, etc) • http://camel.apache.org/languages.html6 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    7. 7. Apache Camel - Architecture7 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    8. 8. What is a Camel Route?  A Route is the step-by-step movement of a message: • From a “listening” endpoint in the role of consumer • Through a processing component - enterprise integration pattern, processor, interceptor, etc. (optional) • To a target endpoint in the role of producer  May involve any number of processing components that modify the original message and/or redirect it  An application developer specifies routes using: • Spring configuration files • Java Domain Specific Language (DSL)8 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    9. 9. Apache Camel – DSL (Domain Specific Language)  Camel provides an embedded DSL (in Java, Spring or Scala) for implementing enterprise integration patterns • The DSL uses URIs to define endpoints which are combined to generate routes (integration flows)9 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    10. 10. Apache Camel - Components  A Component is essentially a factory of Endpoint instances  +80 Components available activemq cxf rss sql mail/imap/pop3 cxfrs snmp timer amqp dataset ftp/ftps/sftp jbi atom db4o velocity jcr bean direct restlet jdbc ldap ejb hibernate jetty browse xquery hl7 jms cache quartz http jmx mock exec ibatis jpa netty file irc xslt10 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    11. 11. Apache Camel - Endpoints  An Endpoint is an instance of the component that can create or receive messages, for example, an FTP server, a Web Service, or a JMS broker  Camel allows you to specifiy endpoints using simple URIs • ftp://john@localhost/ftp?password=xxx • activemq:queue:MyQueue Camel Route FTP JMS Consumer Processor Producer11 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    12. 12. Apache Camel - Consumers and Producers  Message Consumers and Producers are created from endpoints • Some endpoint technologies can create producers and consumers, others support the creation of either a producer or a consumerftp://john@localhost/ftp?password=xxx Camel Route FTP JMS Consumer Processor Producer activemq:queue:MyQueue12 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    13. 13. Apache Camel - Sample Route  Typical scenario: "read an XML file from an FTP server, process it using XSLT, and then send it to a JMS queue” • Its natural to consider an FTP consumer that consumes the message… • … which gets sent to a processor for transformation … • … which gets sent to a JMS message producer for placement on the queue Camel Route FTP JMS Consumer Processor Producer13 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    14. 14. Apache Camel – Sample Route  Java DSL from("ftp://john@localhost/ftp?password=xxx") .to("xslt:MyTransform.xslt") .to("activemq:queue:MyQueue") Camel Route FTP JMS Consumer Processor Producer14 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    15. 15. Apache Camel – Sample Route  Spring XML DSL <camelContext id=“camel” xmlns=“http://activemq.apache.org/camel/schema/spring”> <route> <from uri=“ftp://john@localhost/ftp?password=xxx”/> <to uri=“xslt:MyTransform.xslt”/> <to uri=“activemq:queue:MyQueue”/> </route> </camelContext>  Clean Integration with Spring Beans <bean id=“activemq” class=“org.apache.activemq.camel.component.ActiveMQComponent”> <property name=“brokerURL” value=“tcp://localhost:61616”/> </bean>15 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    16. 16. Apache Camel – Spring Bean Integration  Spring Bean as Message Translator from("activemq:queue:Incoming”). beanRef("myBeanName", "someMethod"). to("activemq:Outgoing"); public class Foo { public String someMethod(String name) { return “Hello “ + name; } }16 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    17. 17. Typical Camel Route Development Process  Use a Maven archetype to generate an outline project  Edit the POM to include additional dependencies  Add your Java code into src/main/java, and/or Spring configuration to src/main/resources/META-INF/spring  Add instructions to the Maven Felix plugin, to assist in the generation of OSGi manifest information  Test using the Camel Maven plugin mvn camel:run  Deploy into the Apache ServiceMix OSGi container • Drop into deploy/ directory (pre-production testing) • Install a bundle/feature from a maven repository (production environment)17 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    18. 18. Camel Testing Options  Test Kit • camel-test JAR (JUnit) • camel-testng JAR (TestNG) • Supports Spring • Easy to test • Quick prototyping18 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    19. 19. Camel Deployment Options  Deployment Strategy Common Containers • No Container dependency • Lightweight Apache ServiceMix Apache ActiveMQ • Embeddable Apache Tomcat  Deployment Options Jetty JBoss • Standalone IBM WebSphere • WAR Oracle WebLogic • Spring Oracle OC4j Glassfish • JEE Google App Engine • OSGi Amazon EC2 • Cloud ... others19 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company
    20. 20. Thanks!No vendor lock-in Free to redistribute Enterprise class A Progress Software Company20 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company

    ×