SlideShare a Scribd company logo
Introduction to
                 Apache Camel


Bosanac Dejan
January 2011




                            A Progress Software
                            Company
About me

 Bosanac Dejan
 Senior Software Engineer at FUSESource - http://
  fusesource.com
 Apache ActiveMQ committer and PMC member
 Co-author of ActiveMQ in Action




2   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                           Company
What is Apache Camel?



      Apache Camel is a powerful Open Source Integration
    Framework based on known Enterprise Integration Patterns




3    © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Why Apache Camel?



 Integration can be messy - variety of protocols and
  data formats
 Framework hides all complexity so you can focus on
  your business logic




4   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                           Company
Route example

                                           Content Based Router




5   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                           Company
Content based Router - 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>


6     © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                             Company
Content Based Router - Java DSL




    from("activemq:NewOrders")
      .choice()
        .when().xpath(“/order/product = 'widget'”)
          .to(“activemq:Orders.Widget”)
        .otherwise()
          .to(“activemq:Orders.Gadget”);




7     © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                             Company
50 Enterprise Integration Patterns

       http://camel.apache.org/enterprise-integration-patterns.html




8   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                           Company
80 Components

                       http://camel.apache.org/components.html

       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


9      © 2010 FuseSource, a Progress Software Company. All rights reserved.                   A Progress Software
                                                                                              Company
80 Components

                                http://camel.apache.org/components.html

          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


10   © 2010 FuseSource, a Progress Software Company. All rights reserved.                       A Progress Software
                                                                                                Company
19 Data Formats

                                http://camel.apache.org/data-format.html

                                             bindy                            protobuf
                                             castor                         serialization
                                               csv                               soap
                                             crypto                             syslog
                                             dozer                          tidy markup
                                            flatpack                          xml beans
                                              gzip                          xml security
                                               hl7                             xstream
                                              jaxb                                zip
                                              json

                                from("activemq:QueueWithJavaObjects”)
                                    .marshal().jaxb()
                                    .to("mq:QueueWithXmlMessages");



11   © 2010 FuseSource, a Progress Software Company. All rights reserved.                   A Progress Software
                                                                                            Company
14 Expression Languaes


                            http://camel.apache.org/languages.html


                                         BeanShell                           PHP
                                               EL                           Python
                                           Groovy                           Ruby
                                        JavaScript                          Simple
                                          JSR 223                            SQL
                                            OGNL                            XPath
                                            MVEL                            XQuery




12   © 2010 FuseSource, a Progress Software Company. All rights reserved.            A Progress Software
                                                                                     Company
DSL in 3 programming Languages

                                                                   Java
                                             from(A).filter(isWidget).to(B);
XML
<route>
  <from ref="A"/>
  <filter>
    <xpath>/quote/product = ‘widget’</xpath>
    <to ref="B"/>
  </filter>
</route>
                                                                         Scala
                                                    from(A) filter(isWidget) --> B




13   © 2010 FuseSource, a Progress Software Company. All rights reserved.     A Progress Software
                                                                              Company
Running Camel


                                                                     Known Containers
    Deployment Strategy
                                                                     Apache ServiceMix
     •    No container dependency
     •    Lightweight                                                Apache ActiveMQ
     •    Embeddable                                                 Apache Tomcat
    Deployment Options                                              Jetty
     •    Standalone
                                                                     JBoss
     •    WAR
     •    Spring                                                     IBM WebSphere
     •    J2EE
                                                                     Oracle WebLogic
     •    JBI
                                                                     Oracle OC4j
     •    OSGi
     •    Cloud                                                      Glassfish

                                                                     Google App Engine

                                                                     ... others



14    © 2010 FuseSource, a Progress Software Company. All rights reserved.               A Progress Software
                                                                                         Company
Running Camel

     Java Application

CamelContext context = new DefaultCamelContext();
context.addRoutes(new MyRouteBuilder());
context.start();


     Spring Application

<camelContext>
  <package>com.acme</package>
</camelContext>




15    © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                             Company
Managing Camel

 JMX API
 REST API




     Fuse HQ SOA management and monitoring system based on
                     Hyperic HQ Enterprise
16     © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                              Company
Developer Web Console




17   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
FuseSource Rider




18   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Rider Auto Parts Example by Jonathan Anstey

     http://architects.dzone.com/articles/apache-camel-integration




19   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Rider Auto Parts Example by Jonathan Anstey

     http://architects.dzone.com/articles/apache-camel-integration


                                                                1




20   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Rider Auto Parts Example by Jonathan Anstey

     http://architects.dzone.com/articles/apache-camel-integration


                                                                1




                2




21   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Rider Auto Parts Example by Jonathan Anstey

     http://architects.dzone.com/articles/apache-camel-integration


                                                                1




                                                                                  3
                2




22   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Rider Example - Spring Configuration

     <broker xmlns="http://activemq.apache.org/schema/core" persistent="false">
           <transportConnectors>
              <transportConnectoruri="tcp://localhost:61616" />
           </transportConnectors>
     </broker>


     <bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
             <property name="brokerURL" value="tcp://localhost:61616"/>
     </bean>


     <bean id="helper" class="org.fusesource.camel.OrderHelper"/>


     <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
           <package>org.fusesource.camel</package>
     </camelContext>
      




23       © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                                Company
Rider Example - Route 1




     public class Route1 extends RouteBuilder {

         public void configure() throws Exception {
           from("ftp:user@rider.com?password=secret")
             .to("activemq:queue:incoming");
         }
     }




24       © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                                Company
Rider Example - Route 2




     public class Route2 extends RouteBuilder {

         public void configure() throws Exception {
           from("jetty:http://localhost:8080/orders")
             .inOnly("activemq:queue:incoming")
             .transform().constant("OK");
         }
     }




25       © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                                Company
Rider Example - Route 3



          public class Route3 extends RouteBuilder {

              public void configure() throws Exception {
                JaxbDataFormat jaxb = new JaxbDataFormat("com.rider");
                BindyDataFormat bindy = new BindyDataFormat("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(bindy)
                        .to("activemq:queue:order")
              }
          }



26   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Rider Example - Data Samples


     XML Data
     <?xml version="1.0" encoding="UTF-8"?>
     <order name="motor" amount="1"/>

     CSV Data
     "name", "amount"
     "brake pad", "2"




27   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Rider Example - Order helper

            public class OrderHelper {
                 public boolean isCsv(String body) {
                     return !body.contains("<?xml");
                 }
             
                 public boolean isXml(String body) {
                     return body.contains("<?xml");
                 }
            }




28   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Rider Example - Order Bean

              @XmlAccessorType(XmlAccessType.FIELD)
              public class Order implements Serializable {
                @XmlAttribute
                private String name;
                @XmlAttribute
                private int amount;
               
                public Order() {
                }
               
                public Order(String name, int amount) {
                  this.name = name;
                  this.amount = amount;
                }
               
                @Override
                public String toString() {
                  return "Order[" + name + " , " + amount + "]";
                }
              }

29   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
What else is there?

    Error handling
    EIP annotations
    Test Kit
    Transactions
    Interceptors
    Security
    ...




30   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
More Information

    Where do I get more information?
    Camel website: http://camel.apache.org
    Camel article: http://architects.dzone.com/articles/apache-camel-
     integration
    Camel in Action book: http://manning.com/ibsen




31    © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                             Company
Blog:
          http://www.nighttale.net/


          Twitter:
          http://twitter.com/dejanb
          http://twitter.com/fusenews




32   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company
Questions?
          Blog:
          http://www.nighttale.net/


          Twitter:
          http://twitter.com/dejanb
          http://twitter.com/fusenews




32   © 2010 FuseSource, a Progress Software Company. All rights reserved.   A Progress Software
                                                                            Company

More Related Content

PPT
Integration made easy with Apache Camel
PPTX
Introduction to Apache Camel
PPT
Simplify your integrations with Apache Camel
PDF
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
PDF
DOSUG Taking Apache Camel For A Ride
PPTX
Apache Camel: The Swiss Army Knife of Open Source Integration
PDF
Taking Apache Camel For A Ride
PDF
Apache Camel Introduction & What's in the box
Integration made easy with Apache Camel
Introduction to Apache Camel
Simplify your integrations with Apache Camel
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
DOSUG Taking Apache Camel For A Ride
Apache Camel: The Swiss Army Knife of Open Source Integration
Taking Apache Camel For A Ride
Apache Camel Introduction & What's in the box

What's hot (20)

PPTX
ApacheCon EU 2016 - Apache Camel the integration library
PDF
Apache Camel - FUSE community day London 2010 presentation
PDF
Apache Camel - The integration library
PDF
Developing Java based microservices ready for the world of containers
ODP
Developing Microservices with Apache Camel
ODP
Using Apache Camel connectors for external connectivity
PPTX
Apache Camel K - Copenhagen
ODP
Getting Started with Apache Camel at DevNation 2014
ODP
Integration using Apache Camel and Groovy
PDF
Developing, Testing and Scaling with Apache Camel - UberConf 2015
PDF
State of integration with Apache Camel (ApacheCon 2019)
PDF
Developing Java based microservices ready for the world of containers
PDF
Event Driven Architecture with Apache Camel
ODP
Getting Started with Apache Camel - Devconf Conference - February 2013
PDF
Enterprise Integration Patterns with Apache Camel
PDF
OSGi ecosystems compared on Apache Karaf - Christian Schneider
PPTX
Apache Camel K - Fredericia
PPTX
Using Apache Camel as AKKA
ODP
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
PDF
Apache Camel in the belly of the Docker whale
ApacheCon EU 2016 - Apache Camel the integration library
Apache Camel - FUSE community day London 2010 presentation
Apache Camel - The integration library
Developing Java based microservices ready for the world of containers
Developing Microservices with Apache Camel
Using Apache Camel connectors for external connectivity
Apache Camel K - Copenhagen
Getting Started with Apache Camel at DevNation 2014
Integration using Apache Camel and Groovy
Developing, Testing and Scaling with Apache Camel - UberConf 2015
State of integration with Apache Camel (ApacheCon 2019)
Developing Java based microservices ready for the world of containers
Event Driven Architecture with Apache Camel
Getting Started with Apache Camel - Devconf Conference - February 2013
Enterprise Integration Patterns with Apache Camel
OSGi ecosystems compared on Apache Karaf - Christian Schneider
Apache Camel K - Fredericia
Using Apache Camel as AKKA
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Apache Camel in the belly of the Docker whale
Ad

Similar to Introduction to Apache Camel (20)

PPTX
Apache camel overview dec 2011
PDF
Make easier Integration of your services with Fuse Solutions - RedHat 2013
PDF
Jazoon 2011 - Smart EAI with Apache Camel
PDF
Camel overview
PDF
Easy Integration with Apache Camel and Fuse IDE
PDF
Introducing Scalate, the Scala Template Engine
PDF
Camel and JBoss
PDF
Systems Integration in the Cloud Era, Kai Wähner MaibornWolff
PDF
20100907 fuse-community-evening-adrian-trenaman-no-logo
PDF
SD Forum 1999 XML Lessons Learned
ZIP
Elegant Systems Integration w/ Apache Camel
PDF
JavaOne 2010: OSGI Migrat
KEY
Modularity with OSGi
PDF
OSGi and Java Modularity
PDF
Jazoon 2012 - Systems Integration in the Cloud Era with Apache Camel
KEY
Survey Of Open Source
PPT
Java overview the piramide of success
PDF
Spark IT 2011 - Java EE 6 Workshop
PPT
Riding with camel
PDF
Devoxx 2011 integration-camel-cxf-servicemix-activemq
Apache camel overview dec 2011
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Jazoon 2011 - Smart EAI with Apache Camel
Camel overview
Easy Integration with Apache Camel and Fuse IDE
Introducing Scalate, the Scala Template Engine
Camel and JBoss
Systems Integration in the Cloud Era, Kai Wähner MaibornWolff
20100907 fuse-community-evening-adrian-trenaman-no-logo
SD Forum 1999 XML Lessons Learned
Elegant Systems Integration w/ Apache Camel
JavaOne 2010: OSGI Migrat
Modularity with OSGi
OSGi and Java Modularity
Jazoon 2012 - Systems Integration in the Cloud Era with Apache Camel
Survey Of Open Source
Java overview the piramide of success
Spark IT 2011 - Java EE 6 Workshop
Riding with camel
Devoxx 2011 integration-camel-cxf-servicemix-activemq
Ad

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
A Presentation on Artificial Intelligence
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25 Week I
A Presentation on Artificial Intelligence
Machine learning based COVID-19 study performance prediction
NewMind AI Monthly Chronicles - July 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Introduction to Apache Camel

  • 1. Introduction to Apache Camel Bosanac Dejan January 2011 A Progress Software Company
  • 2. About me  Bosanac Dejan  Senior Software Engineer at FUSESource - http:// fusesource.com  Apache ActiveMQ committer and PMC member  Co-author of ActiveMQ in Action 2 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 3. What is Apache Camel? Apache Camel is a powerful Open Source Integration Framework based on known Enterprise Integration Patterns 3 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 4. Why Apache Camel?  Integration can be messy - variety of protocols and data formats  Framework hides all complexity so you can focus on your business logic 4 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 5. Route example Content Based Router 5 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 6. Content based Router - 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> 6 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 7. Content Based Router - Java DSL from("activemq:NewOrders") .choice() .when().xpath(“/order/product = 'widget'”) .to(“activemq:Orders.Widget”) .otherwise() .to(“activemq:Orders.Gadget”); 7 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 8. 50 Enterprise Integration Patterns http://camel.apache.org/enterprise-integration-patterns.html 8 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 9. 80 Components http://camel.apache.org/components.html 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 9 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 10. 80 Components http://camel.apache.org/components.html 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 10 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 11. 19 Data Formats http://camel.apache.org/data-format.html bindy protobuf castor serialization csv soap crypto syslog dozer tidy markup flatpack xml beans gzip xml security hl7 xstream jaxb zip json from("activemq:QueueWithJavaObjects”) .marshal().jaxb() .to("mq:QueueWithXmlMessages"); 11 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 12. 14 Expression Languaes http://camel.apache.org/languages.html BeanShell PHP EL Python Groovy Ruby JavaScript Simple JSR 223 SQL OGNL XPath MVEL XQuery 12 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 13. DSL in 3 programming Languages Java from(A).filter(isWidget).to(B); XML <route> <from ref="A"/> <filter> <xpath>/quote/product = ‘widget’</xpath> <to ref="B"/> </filter> </route> Scala from(A) filter(isWidget) --> B 13 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 14. Running Camel Known Containers  Deployment Strategy Apache ServiceMix • No container dependency • Lightweight Apache ActiveMQ • Embeddable Apache Tomcat  Deployment Options Jetty • Standalone JBoss • WAR • Spring IBM WebSphere • J2EE Oracle WebLogic • JBI Oracle OC4j • OSGi • Cloud Glassfish Google App Engine ... others 14 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 15. Running Camel Java Application CamelContext context = new DefaultCamelContext(); context.addRoutes(new MyRouteBuilder()); context.start(); Spring Application <camelContext> <package>com.acme</package> </camelContext> 15 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 16. Managing Camel  JMX API  REST API Fuse HQ SOA management and monitoring system based on Hyperic HQ Enterprise 16 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 17. Developer Web Console 17 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 18. FuseSource Rider 18 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 19. Rider Auto Parts Example by Jonathan Anstey http://architects.dzone.com/articles/apache-camel-integration 19 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 20. Rider Auto Parts Example by Jonathan Anstey http://architects.dzone.com/articles/apache-camel-integration 1 20 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 21. Rider Auto Parts Example by Jonathan Anstey http://architects.dzone.com/articles/apache-camel-integration 1 2 21 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 22. Rider Auto Parts Example by Jonathan Anstey http://architects.dzone.com/articles/apache-camel-integration 1 3 2 22 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 23. Rider Example - Spring Configuration <broker xmlns="http://activemq.apache.org/schema/core" persistent="false"> <transportConnectors> <transportConnectoruri="tcp://localhost:61616" /> </transportConnectors> </broker> <bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="brokerURL" value="tcp://localhost:61616"/> </bean> <bean id="helper" class="org.fusesource.camel.OrderHelper"/> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring"> <package>org.fusesource.camel</package> </camelContext>   23 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 24. Rider Example - Route 1 public class Route1 extends RouteBuilder { public void configure() throws Exception { from("ftp:user@rider.com?password=secret") .to("activemq:queue:incoming"); } } 24 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 25. Rider Example - Route 2 public class Route2 extends RouteBuilder { public void configure() throws Exception { from("jetty:http://localhost:8080/orders") .inOnly("activemq:queue:incoming") .transform().constant("OK"); } } 25 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 26. Rider Example - Route 3 public class Route3 extends RouteBuilder { public void configure() throws Exception { JaxbDataFormat jaxb = new JaxbDataFormat("com.rider"); BindyDataFormat bindy = new BindyDataFormat("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(bindy) .to("activemq:queue:order") } } 26 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 27. Rider Example - Data Samples XML Data <?xml version="1.0" encoding="UTF-8"?> <order name="motor" amount="1"/> CSV Data "name", "amount" "brake pad", "2" 27 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 28. Rider Example - Order helper public class OrderHelper { public boolean isCsv(String body) { return !body.contains("<?xml"); }   public boolean isXml(String body) { return body.contains("<?xml"); } } 28 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 29. Rider Example - Order Bean @XmlAccessorType(XmlAccessType.FIELD) public class Order implements Serializable { @XmlAttribute private String name; @XmlAttribute private int amount;   public Order() { }   public Order(String name, int amount) { this.name = name; this.amount = amount; }   @Override public String toString() { return "Order[" + name + " , " + amount + "]"; } } 29 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 30. What else is there?  Error handling  EIP annotations  Test Kit  Transactions  Interceptors  Security  ... 30 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 31. More Information  Where do I get more information?  Camel website: http://camel.apache.org  Camel article: http://architects.dzone.com/articles/apache-camel- integration  Camel in Action book: http://manning.com/ibsen 31 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 32. Blog: http://www.nighttale.net/ Twitter: http://twitter.com/dejanb http://twitter.com/fusenews 32 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company
  • 33. Questions? Blog: http://www.nighttale.net/ Twitter: http://twitter.com/dejanb http://twitter.com/fusenews 32 © 2010 FuseSource, a Progress Software Company. All rights reserved. A Progress Software Company