SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

ApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryClaus Ibsen
 
Apache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentationApache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentationClaus Ibsen
 
Apache Camel - The integration library
Apache Camel - The integration libraryApache Camel - The integration library
Apache Camel - The integration libraryClaus Ibsen
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersClaus Ibsen
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache CamelClaus Ibsen
 
Using Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivityUsing Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivityClaus Ibsen
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - CopenhagenClaus Ibsen
 
Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014Claus Ibsen
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyClaus Ibsen
 
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Matt Raible
 
State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)Claus Ibsen
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersClaus Ibsen
 
Event Driven Architecture with Apache Camel
Event Driven Architecture with Apache CamelEvent Driven Architecture with Apache Camel
Event Driven Architecture with Apache Camelprajods
 
Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Claus Ibsen
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelIoan Eugen Stan
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneidermfrancis
 
Apache Camel K - Fredericia
Apache Camel K - FredericiaApache Camel K - Fredericia
Apache Camel K - FredericiaClaus Ibsen
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKAJohan Edstrom
 
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014Claus Ibsen
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleHenryk Konsek
 

Tendances (20)

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

Similaire à Introduction to Apache Camel

Camel and JBoss
Camel and JBossCamel and JBoss
Camel and JBossJBug Italy
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011Marcelo Jabali
 
Easy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDEEasy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDEJBUG London
 
OSGi Service Platform 4.2
OSGi Service Platform 4.2OSGi Service Platform 4.2
OSGi Service Platform 4.2Ilya Katsov
 
Introductiontoapachecamel 110131060022-phpapp01
Introductiontoapachecamel 110131060022-phpapp01Introductiontoapachecamel 110131060022-phpapp01
Introductiontoapachecamel 110131060022-phpapp01dheeraj kumar
 
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5David Nuescheler
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
Chisimba - introduction to practical demo
Chisimba - introduction to practical demoChisimba - introduction to practical demo
Chisimba - introduction to practical demoDerek Keats
 
IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012Olivier MJ Crépin-Leblond
 
IPv6 Matrix Exec Summary Dec 2011 Results - ICCA Pondicherry 31 Jan 2012
IPv6 Matrix Exec Summary Dec 2011 Results - ICCA Pondicherry 31 Jan 2012IPv6 Matrix Exec Summary Dec 2011 Results - ICCA Pondicherry 31 Jan 2012
IPv6 Matrix Exec Summary Dec 2011 Results - ICCA Pondicherry 31 Jan 2012Olivier MJ Crépin-Leblond
 
Eb07 Day Communiqué Web Content Management En
Eb07 Day Communiqué Web Content Management EnEb07 Day Communiqué Web Content Management En
Eb07 Day Communiqué Web Content Management EnValtech
 
Web Content Management And Agile
Web Content Management And AgileWeb Content Management And Agile
Web Content Management And AgileValtech UK
 
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integrationSouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integrationClaus Ibsen
 
Deploying JRuby Web Applications
Deploying JRuby Web ApplicationsDeploying JRuby Web Applications
Deploying JRuby Web ApplicationsJoe Kutner
 

Similaire à Introduction to Apache Camel (20)

Camel and JBoss
Camel and JBossCamel and JBoss
Camel and JBoss
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011
 
Easy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDEEasy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDE
 
Camel overview
Camel overview Camel overview
Camel overview
 
OSGi Service Platform 4.2
OSGi Service Platform 4.2OSGi Service Platform 4.2
OSGi Service Platform 4.2
 
Introductiontoapachecamel 110131060022-phpapp01
Introductiontoapachecamel 110131060022-phpapp01Introductiontoapachecamel 110131060022-phpapp01
Introductiontoapachecamel 110131060022-phpapp01
 
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
 
Introducing JSR-283
Introducing JSR-283Introducing JSR-283
Introducing JSR-283
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Chisimba - introduction to practical demo
Chisimba - introduction to practical demoChisimba - introduction to practical demo
Chisimba - introduction to practical demo
 
JavaOne 2010: OSGI Migrat
JavaOne 2010: OSGI MigratJavaOne 2010: OSGI Migrat
JavaOne 2010: OSGI Migrat
 
IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012
 
What's new in JSR-283?
What's new in JSR-283?What's new in JSR-283?
What's new in JSR-283?
 
IPv6 Matrix Exec Summary Dec 2011 Results - ICCA Pondicherry 31 Jan 2012
IPv6 Matrix Exec Summary Dec 2011 Results - ICCA Pondicherry 31 Jan 2012IPv6 Matrix Exec Summary Dec 2011 Results - ICCA Pondicherry 31 Jan 2012
IPv6 Matrix Exec Summary Dec 2011 Results - ICCA Pondicherry 31 Jan 2012
 
Eb07 Day Communiqué Web Content Management En
Eb07 Day Communiqué Web Content Management EnEb07 Day Communiqué Web Content Management En
Eb07 Day Communiqué Web Content Management En
 
Agile Edge Valtech
Agile Edge ValtechAgile Edge Valtech
Agile Edge Valtech
 
Web Content Management And Agile
Web Content Management And AgileWeb Content Management And Agile
Web Content Management And Agile
 
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integrationSouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
 
Deploying JRuby Web Applications
Deploying JRuby Web ApplicationsDeploying JRuby Web Applications
Deploying JRuby Web Applications
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
 

Dernier

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Dernier (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

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