SlideShare a Scribd company logo
Getting Started with Apache Camel



    Claus Ibsen (@davsclaus)
    Principal Software Engineer, Red Hat
    At Devconf.cz, february 2013




1                 PUBLIC PRESENTATION | CLAUS IBSEN
Agenda

    ●   What is Apache Camel?
    ●   A little Example
    ●   Riding Camel
    ●   What's in the Camel box?
    ●   Deploying Camel
    ●   Creating new Camel Projects
    ●   Q and A




2                          PUBLIC PRESENTATION | CLAUS IBSEN
Your Speaker

    ●   Principal Software Engineer at Red Hat
    ●   Apache Camel
         ●   5 years working with Camel
    ●   Author of Camel in Action book
    ●   Contact
         ●   EMail: cibsen@redhat.com
         ●   Twitter: @davsclaus
         ●   Blog: http://davsclaus.com




3                             PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

    ●   Quote from the website




4                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

    ●   Why do we need integration?
         ●   Critical for your business to integrate
    ●   Why Integration Framework?
         ●   Framework do the heavy lifting
         ●   You can focus on business problem
         ●   Not "reinventing the wheel"




5                               PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

    ●   What is Enterprise Integration Patterns?




                          It's a book

6                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

    ●   Enterprise Integration Patterns




                   http://camel.apache.org/eip

7                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

    ●   EIP - Content Based Router




8                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




    from newOrder




9                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




     from newOrder
       choice




10                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




     from newOrder
       choice
         when isWidget to widget




11                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




     from newOrder
       choice
         when isWidget to widget
         otherwise to gadget




12                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




     from(newOrder)
       choice
         when(isWidget) to(widget)
         otherwise to(gadget)




13                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




     from(newOrder)
       .choice()
         .when(isWidget).to(widget)
         .otherwise().to(gadget);




14                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




     Endpoint newOrder = endpoint("activemq:queue:newOrder");




     from(newOrder)
       .choice()
         .when(isWidget).to(widget)
         .otherwise().to(gadget);




15                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




     Endpoint newOrder = endpoint("activemq:queue:newOrder");
     Predicate isWidget = xpath("/order/product = 'widget'");



     from(newOrder)
       .choice()
         .when(isWidget).to(widget)
         .otherwise().to(gadget);




16                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?




     Endpoint newOrder = endpoint("activemq:queue:newOrder");
     Predicate isWidget = xpath("/order/product = 'widget'");
     Endpoint widget = endpoint("activemq:queue:widget");
     Endpoint gadget = endpoint("activemq:queue:gadget");

     from(newOrder)
       .choice()
         .when(isWidget).to(widget)
         .otherwise().to(gadget);




17                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

 ●   Java Code




        public void configure() throws Exception {
          Endpoint newOrder = endpoint("activemq:queue:newOrder");
          Predicate isWidget = xpath("/order/product = 'widget'");
          Endpoint widget = endpoint("activemq:queue:widget");
          Endpoint gadget = endpoint("activemq:queue:gadget");

            from(newOrder)
              .choice()
                .when(isWidget).to(widget)
                .otherwise().to(gadget)
              .end();
        }

18                           PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

 ●   Java Code
       import org.apache.camel.Endpoint;
       import org.apache.camel.Predicate;
       import org.apache.camel.builder.RouteBuilder;

       public class MyRoute extends RouteBuilder {

           public void configure() throws Exception {
             Endpoint newOrder = endpoint("activemq:queue:newOrder");
             Predicate isWidget = xpath("/order/product = 'widget'");
             Endpoint widget = endpoint("activemq:queue:widget");
             Endpoint gadget = endpoint("activemq:queue:gadget");

               from(newOrder)
                 .choice()
                   .when(isWidget).to(widget)
                   .otherwise().to(gadget)
                 .end();
           }
       }
19                              PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

 ●   Camel Java DSL

       import org.apache.camel.builder.RouteBuilder;

       public class MyRoute extends RouteBuilder {

           public void configure() throws Exception {
             from("activemq:queue:newOrder")
               .choice()
                 .when(xpath("/order/product = 'widget'"))
                   .to("activemq:queue:widget")
                 .otherwise()
                   .to("activemq:queue:gadget")
               .end();
           }
       }



20                            PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

 ●   Camel XML DSL
        <route>
          <from uri="activemq:queue:newOrder"/>
          <choice>
            <when>
              <xpath>/order/product = 'widget'</xpath>
              <to uri="activemq:queue:widget"/>
            </when>
            <otherwise>
              <to uri="activemq:queue:gadget"/>
            </otherwise>
          </choice>
        </route>




21                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?
                                          use file instead
 ●   Endpoint as URIs
        <route>
          <from uri="file:inbox/orders"/>
          <choice>
            <when>
              <xpath>/order/product = 'widget'</xpath>
              <to uri="activemq:queue:widget"/>
            </when>
            <otherwise>
              <to uri="activemq:queue:gadget"/>
            </otherwise>
          </choice>
        </route>




22                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?
                                                               parameters
 ●   Endpoint as URIs
        <route>
          <from uri="file:inbox/orders?delete=true"/>
          <choice>
            <when>
              <xpath>/order/product = 'widget'</xpath>
              <to uri="activemq:queue:widget"/>
            </when>
            <otherwise>
              <to uri="activemq:queue:gadget"/>
            </otherwise>
          </choice>
        </route>




23                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

 ●   Camel's Architecture




24                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     120+ Components




25                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     120+ Components




26                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

 ●   Summary
     ●   Integration Framework
     ●   Enterprise Integration Patterns (EIP)
     ●   Routing (using DSL)
     ●   Easy Configuration (endpoint as uri's)
     ●   Payload Agnostic
     ●   No Container Dependency
     ●   A lot of components




27                          PUBLIC PRESENTATION | CLAUS IBSEN
Agenda

 ●   What is Apache Camel?
 ●   A little Example
 ●   Riding Camel
 ●   What's in the Camel box?
 ●   Deploying Camel
 ●   Creating new Camel Projects
 ●   Extending Camel
 ●   Q and A



28                      PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example

 ●   File Copier Example




29                     PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example

 ●   File Copier Example




30                     PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example

 ●   File Copier Example




31                     PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example

 ●   File Copier Example




32                     PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example

 ●   File Copier Example




33                     PUBLIC PRESENTATION | CLAUS IBSEN
Agenda

 ●   What is Apache Camel?
 ●   A little Example
 ●   Riding Camel
 ●   What's in the Camel box?
 ●   Deploying Camel
 ●   Creating new Camel Projects
 ●   Q and A




34                      PUBLIC PRESENTATION | CLAUS IBSEN
Riding Camel

 ●   Downloading Apache Camel
     ●   zip/tarball (approx 14mb)




                                                      http://camel.apache.org




35                        PUBLIC PRESENTATION | CLAUS IBSEN
Riding Camel

 ●   Using Command Shell
      ●   Requires: Apache Maven




 ●   From Eclipse




36                       PUBLIC PRESENTATION | CLAUS IBSEN
Riding Camel

 ●   Console Example




 ●   cd examples/camel-example-console
 ●   mvn compile exec:java

37                     PUBLIC PRESENTATION | CLAUS IBSEN
Riding Camel

 ●   Twitter Example




 ●   cd examples/camel-example-twitter-websocket
 ●   mvn compile exec:java                  http://localhost:9090/index.html



38                     PUBLIC PRESENTATION | CLAUS IBSEN
Riding Camel

 ●   More examples ...




     ... and further details at website.

                http://camel.apache.org/examples




39                        PUBLIC PRESENTATION | CLAUS IBSEN
Agenda

 ●   What is Apache Camel?
 ●   A little Example
 ●   Riding Camel
 ●   What's in the box?
 ●   Deploying Camel
 ●   Creating new Camel Projects
 ●   Q and A




40                      PUBLIC PRESENTATION | CLAUS IBSEN
What's in the box?




41                   PUBLIC PRESENTATION | CLAUS IBSEN
What's in the box?

 ●   Enterprise Integration Patterns




                http://camel.apache.org/eip

42                     PUBLIC PRESENTATION | CLAUS IBSEN
What's in the box?

 ●   Splitter EIP




43                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     120+ Components




44                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     19 Data Formats




45                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     15 Expression Languages




46                    PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     5+ DSL in multiple languages
      ●   Java DSL
      ●   XML DSL (Spring and OSGi Blueprint)
      ●   Groovy DSL
      ●   Scala DSL
      ●   Kotlin DSL (work in progress)




47                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     Test Kit
      ●   camel-test                      camel-test-spring
      ●   camel-test-blueprint            camel-testng




48                          PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     Management
     ●   JMX
     ●   REST




49                PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     Tooling – Web console - HawtIO




                       http://hawt.io
50                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     Tooling – Eclipse Plugin – Fuse IDE




              http://github.com/fusesource/fuseide
51                      PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     Error Handling




52                    PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     try .. catch style




53                        PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?

     Dead Letter Channel (EIP style)




54                      PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?
     The Rest
     ●   Interceptors
     ●   Security
     ●   Route Policy
     ●   Type Converters
     ●   Transaction
          ●   Compensation as rollback
     ●   Asynchronous non-blocking routing engine
     ●   Thread management
     ●   Maven Tooling
     ●   ... and much more
55                           PUBLIC PRESENTATION | CLAUS IBSEN
Agenda

 ●   What is Apache Camel?
 ●   A little Example
 ●   Riding Camel
 ●   What's in the Camel box?
 ●   Deploying Camel
 ●   Creating new Camel Projects
 ●   Extending Camel
 ●   Q and A



56                      PUBLIC PRESENTATION | CLAUS IBSEN
Deploying Camel

 ●   Deployment Strategy
     ●   No Container Dependency
     ●   Lightweight & Embeddable
 ●   Deployment Options
     ●   Standalone
     ●   WAR
     ●   Spring
     ●   JEE
     ●   OSGi
     ●   Cloud

57                       PUBLIC PRESENTATION | CLAUS IBSEN
Camel as a Client

 ●   Java Client Application (no routes)
 ●   Example
      ●   Upload a file to a FTP server




58                          PUBLIC PRESENTATION | CLAUS IBSEN
Agenda

 ●   What is Apache Camel?
 ●   A little Example
 ●   Riding Camel
 ●   What's in the Camel box?
 ●   Deploying Camel
 ●   Creating new Camel Projects
 ●   Q and A




59                      PUBLIC PRESENTATION | CLAUS IBSEN
Creating new Camel Projects

 ●   Using Command Shell




 ●   From Eclipse




60                   PUBLIC PRESENTATION | CLAUS IBSEN
Creating new Camel Projects

 ●   Maven Archetypes




61                      PUBLIC PRESENTATION | CLAUS IBSEN
Creating new Camel Projects

 ●   camel-archetype-blueprint




62                     PUBLIC PRESENTATION | CLAUS IBSEN
Creating new Camel Projects

 ●   Importing into Eclipse




                                                       Existing Maven Project




63                      PUBLIC PRESENTATION | CLAUS IBSEN
Creating new Camel Projects

 ●   Testing Camel Projects




 ●   ... from inside Eclipse


64                       PUBLIC PRESENTATION | CLAUS IBSEN
Agenda

 ●   What is Apache Camel?
 ●   A little Example
 ●   Riding Camel
 ●   What's in the Camel box?
 ●   Deploying Camel
 ●   Creating new Camel Projects
 ●   Q and A




65                      PUBLIC PRESENTATION | CLAUS IBSEN
Where do I get more information?
 ●   Best Article covering what Apache Camel is
      ●   http://java.dzone.com/articles/open-source-integration-
          apache




                                                        Link to article from “Getting Started”




66                          PUBLIC PRESENTATION | CLAUS IBSEN
Where do I get more information?
 ●   Try Camel Examples
      ●   http://camel.apache.org/examples.html


 ●   Read other blogs and articles
      ●   http://camel.apache.org/articles.html


 ●   Use the “search box” on the Camel front page




67                          PUBLIC PRESENTATION | CLAUS IBSEN
Where do I get more information?
 ●   Use the mailing list / forum
      ●   http://camel.apache.org/mailing-lists.html


 ●   Use stackoverflow
      ●   http://stackoverflow.com/questions/tagged/apache-camel




68                          PUBLIC PRESENTATION | CLAUS IBSEN
Where do I get more information?
 ●   Buy the Camel in Action book




                                                                Use code ...
                                                                  camel40
                                                             … for 40% discount




                   http://manning.com/ibsen/




69                       PUBLIC PRESENTATION | CLAUS IBSEN
Any Questions ?



●    Contact
      ● EMail: cibsen@redhat.com
      ● Twitter: @davsclaus
      ● Blog: http://davsclaus.com




    70                               PUBLIC PRESENTATION | CLAUS IBSEN

More Related Content

ODP
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
ODP
Getting started with Apache Camel - May 2013
ODP
Getting started with Apache Camel presentation at BarcelonaJUG, january 2014
ODP
Microservices with apache_camel_barcelona
PDF
Getting started with Apache Camel - jDays 2013
ODP
Integration using Apache Camel and Groovy
ODP
Microservices with Apache Camel
PDF
Apache Camel - The integration library
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - May 2013
Getting started with Apache Camel presentation at BarcelonaJUG, january 2014
Microservices with apache_camel_barcelona
Getting started with Apache Camel - jDays 2013
Integration using Apache Camel and Groovy
Microservices with Apache Camel
Apache Camel - The integration library

What's hot (20)

ODP
Using Apache Camel connectors for external connectivity
ODP
Getting Started with Apache Camel at DevNation 2014
ODP
Apache Camel workshop at BarcelonaJUG in January 2014
PPT
Integration made easy with Apache Camel
PDF
Enterprise Integration Patterns with Apache Camel
ODP
Getting Started with Apache Camel - Malmo JUG - March 2013
PDF
Developing Java based microservices ready for the world of containers
ODP
Developing Microservices with Apache Camel
PDF
Camel Day Italy 2021 - What's new in Camel 3
PDF
Apache Camel Introduction & What's in the box
PPTX
Introduction to Apache Camel
PDF
Apache Camel - FUSE community day London 2010 presentation
PPTX
ApacheCon EU 2016 - Apache Camel the integration library
PDF
Event Driven Architecture with Apache Camel
PDF
State of integration with Apache Camel (ApacheCon 2019)
PDF
Developing, Testing and Scaling with Apache Camel - UberConf 2015
PPTX
Using Apache Camel as AKKA
PPT
Simplify your integrations with Apache Camel
PDF
Introduction to Apache Camel
PDF
Taking Apache Camel For A Ride
Using Apache Camel connectors for external connectivity
Getting Started with Apache Camel at DevNation 2014
Apache Camel workshop at BarcelonaJUG in January 2014
Integration made easy with Apache Camel
Enterprise Integration Patterns with Apache Camel
Getting Started with Apache Camel - Malmo JUG - March 2013
Developing Java based microservices ready for the world of containers
Developing Microservices with Apache Camel
Camel Day Italy 2021 - What's new in Camel 3
Apache Camel Introduction & What's in the box
Introduction to Apache Camel
Apache Camel - FUSE community day London 2010 presentation
ApacheCon EU 2016 - Apache Camel the integration library
Event Driven Architecture with Apache Camel
State of integration with Apache Camel (ApacheCon 2019)
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Using Apache Camel as AKKA
Simplify your integrations with Apache Camel
Introduction to Apache Camel
Taking Apache Camel For A Ride
Ad

Similar to Getting Started with Apache Camel - Devconf Conference - February 2013 (20)

PDF
Integration using Apache Camel and Groovy
PDF
Apache Camel Introduction
PPTX
Apache Camel framework Presentation and selection of apache camel for various...
KEY
Apache Camel - JEEConf May 2011
PPTX
Apache Camel K - Fredericia
PDF
Apache camel community day - october 2010
KEY
What Riding the Camel can do to make integration easier for you
PDF
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
KEY
Apache Camel
PDF
Enterprise Integration Patterns and DSL with Apache Camel
ODP
Red Hat Open Day JBoss Fuse
PPTX
Essential Camel Components
PDF
Solving Enterprise Integration with Apache Camel
PPTX
Apache Camel K - Copenhagen v2
PPTX
Apache Camel K - Copenhagen
PDF
apachecamelk-april2019-190409093034.pdf
PDF
Introduction of Apache Camel
PDF
Introduction to Apache Camel
PDF
Introduction To Apache Camel
PDF
Camels in Berlin
Integration using Apache Camel and Groovy
Apache Camel Introduction
Apache Camel framework Presentation and selection of apache camel for various...
Apache Camel - JEEConf May 2011
Apache Camel K - Fredericia
Apache camel community day - october 2010
What Riding the Camel can do to make integration easier for you
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Apache Camel
Enterprise Integration Patterns and DSL with Apache Camel
Red Hat Open Day JBoss Fuse
Essential Camel Components
Solving Enterprise Integration with Apache Camel
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen
apachecamelk-april2019-190409093034.pdf
Introduction of Apache Camel
Introduction to Apache Camel
Introduction To Apache Camel
Camels in Berlin
Ad

More from Claus Ibsen (16)

PDF
Low Code Integration with Apache Camel.pdf
PDF
Camel JBang - Quarkus Insights.pdf
PDF
Integrating systems in the age of Quarkus and Camel
PDF
DevNation Live 2020 - What's new with Apache Camel 3
PDF
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
PDF
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
PDF
Best Practices for Middleware and Integration Architecture Modernization with...
PDF
Apache Camel v3, Camel K and Camel Quarkus
PDF
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
PPTX
Serverless integration with Knative and Apache Camel on Kubernetes
PPTX
Integrating microservices with apache camel on kubernetes
PDF
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
PPTX
Camel riders in the cloud
PDF
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
PDF
Developing Java based microservices ready for the world of containers
PDF
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Low Code Integration with Apache Camel.pdf
Camel JBang - Quarkus Insights.pdf
Integrating systems in the age of Quarkus and Camel
DevNation Live 2020 - What's new with Apache Camel 3
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
Best Practices for Middleware and Integration Architecture Modernization with...
Apache Camel v3, Camel K and Camel Quarkus
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Serverless integration with Knative and Apache Camel on Kubernetes
Integrating microservices with apache camel on kubernetes
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
Camel riders in the cloud
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
Developing Java based microservices ready for the world of containers
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes

Recently uploaded (20)

PDF
Modernizing your data center with Dell and AMD
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Machine learning based COVID-19 study performance prediction
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Cloud computing and distributed systems.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Empathic Computing: Creating Shared Understanding
PDF
cuic standard and advanced reporting.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Electronic commerce courselecture one. Pdf
Modernizing your data center with Dell and AMD
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Monthly Chronicles - July 2025
Machine learning based COVID-19 study performance prediction
The AUB Centre for AI in Media Proposal.docx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Cloud computing and distributed systems.
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
Empathic Computing: Creating Shared Understanding
cuic standard and advanced reporting.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Electronic commerce courselecture one. Pdf

Getting Started with Apache Camel - Devconf Conference - February 2013

  • 1. Getting Started with Apache Camel Claus Ibsen (@davsclaus) Principal Software Engineer, Red Hat At Devconf.cz, february 2013 1 PUBLIC PRESENTATION | CLAUS IBSEN
  • 2. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● What's in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Q and A 2 PUBLIC PRESENTATION | CLAUS IBSEN
  • 3. Your Speaker ● Principal Software Engineer at Red Hat ● Apache Camel ● 5 years working with Camel ● Author of Camel in Action book ● Contact ● EMail: cibsen@redhat.com ● Twitter: @davsclaus ● Blog: http://davsclaus.com 3 PUBLIC PRESENTATION | CLAUS IBSEN
  • 4. What is Apache Camel? ● Quote from the website 4 PUBLIC PRESENTATION | CLAUS IBSEN
  • 5. What is Apache Camel? ● Why do we need integration? ● Critical for your business to integrate ● Why Integration Framework? ● Framework do the heavy lifting ● You can focus on business problem ● Not "reinventing the wheel" 5 PUBLIC PRESENTATION | CLAUS IBSEN
  • 6. What is Apache Camel? ● What is Enterprise Integration Patterns? It's a book 6 PUBLIC PRESENTATION | CLAUS IBSEN
  • 7. What is Apache Camel? ● Enterprise Integration Patterns http://camel.apache.org/eip 7 PUBLIC PRESENTATION | CLAUS IBSEN
  • 8. What is Apache Camel? ● EIP - Content Based Router 8 PUBLIC PRESENTATION | CLAUS IBSEN
  • 9. What is Apache Camel? from newOrder 9 PUBLIC PRESENTATION | CLAUS IBSEN
  • 10. What is Apache Camel? from newOrder choice 10 PUBLIC PRESENTATION | CLAUS IBSEN
  • 11. What is Apache Camel? from newOrder choice when isWidget to widget 11 PUBLIC PRESENTATION | CLAUS IBSEN
  • 12. What is Apache Camel? from newOrder choice when isWidget to widget otherwise to gadget 12 PUBLIC PRESENTATION | CLAUS IBSEN
  • 13. What is Apache Camel? from(newOrder) choice when(isWidget) to(widget) otherwise to(gadget) 13 PUBLIC PRESENTATION | CLAUS IBSEN
  • 14. What is Apache Camel? from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget); 14 PUBLIC PRESENTATION | CLAUS IBSEN
  • 15. What is Apache Camel? Endpoint newOrder = endpoint("activemq:queue:newOrder"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget); 15 PUBLIC PRESENTATION | CLAUS IBSEN
  • 16. What is Apache Camel? Endpoint newOrder = endpoint("activemq:queue:newOrder"); Predicate isWidget = xpath("/order/product = 'widget'"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget); 16 PUBLIC PRESENTATION | CLAUS IBSEN
  • 17. What is Apache Camel? Endpoint newOrder = endpoint("activemq:queue:newOrder"); Predicate isWidget = xpath("/order/product = 'widget'"); Endpoint widget = endpoint("activemq:queue:widget"); Endpoint gadget = endpoint("activemq:queue:gadget"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget); 17 PUBLIC PRESENTATION | CLAUS IBSEN
  • 18. What is Apache Camel? ● Java Code public void configure() throws Exception { Endpoint newOrder = endpoint("activemq:queue:newOrder"); Predicate isWidget = xpath("/order/product = 'widget'"); Endpoint widget = endpoint("activemq:queue:widget"); Endpoint gadget = endpoint("activemq:queue:gadget"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget) .end(); } 18 PUBLIC PRESENTATION | CLAUS IBSEN
  • 19. What is Apache Camel? ● Java Code import org.apache.camel.Endpoint; import org.apache.camel.Predicate; import org.apache.camel.builder.RouteBuilder; public class MyRoute extends RouteBuilder { public void configure() throws Exception { Endpoint newOrder = endpoint("activemq:queue:newOrder"); Predicate isWidget = xpath("/order/product = 'widget'"); Endpoint widget = endpoint("activemq:queue:widget"); Endpoint gadget = endpoint("activemq:queue:gadget"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget) .end(); } } 19 PUBLIC PRESENTATION | CLAUS IBSEN
  • 20. What is Apache Camel? ● Camel Java DSL import org.apache.camel.builder.RouteBuilder; public class MyRoute extends RouteBuilder { public void configure() throws Exception { from("activemq:queue:newOrder") .choice() .when(xpath("/order/product = 'widget'")) .to("activemq:queue:widget") .otherwise() .to("activemq:queue:gadget") .end(); } } 20 PUBLIC PRESENTATION | CLAUS IBSEN
  • 21. What is Apache Camel? ● Camel XML DSL <route> <from uri="activemq:queue:newOrder"/> <choice> <when> <xpath>/order/product = 'widget'</xpath> <to uri="activemq:queue:widget"/> </when> <otherwise> <to uri="activemq:queue:gadget"/> </otherwise> </choice> </route> 21 PUBLIC PRESENTATION | CLAUS IBSEN
  • 22. What is Apache Camel? use file instead ● Endpoint as URIs <route> <from uri="file:inbox/orders"/> <choice> <when> <xpath>/order/product = 'widget'</xpath> <to uri="activemq:queue:widget"/> </when> <otherwise> <to uri="activemq:queue:gadget"/> </otherwise> </choice> </route> 22 PUBLIC PRESENTATION | CLAUS IBSEN
  • 23. What is Apache Camel? parameters ● Endpoint as URIs <route> <from uri="file:inbox/orders?delete=true"/> <choice> <when> <xpath>/order/product = 'widget'</xpath> <to uri="activemq:queue:widget"/> </when> <otherwise> <to uri="activemq:queue:gadget"/> </otherwise> </choice> </route> 23 PUBLIC PRESENTATION | CLAUS IBSEN
  • 24. What is Apache Camel? ● Camel's Architecture 24 PUBLIC PRESENTATION | CLAUS IBSEN
  • 25. What is Apache Camel? 120+ Components 25 PUBLIC PRESENTATION | CLAUS IBSEN
  • 26. What is Apache Camel? 120+ Components 26 PUBLIC PRESENTATION | CLAUS IBSEN
  • 27. What is Apache Camel? ● Summary ● Integration Framework ● Enterprise Integration Patterns (EIP) ● Routing (using DSL) ● Easy Configuration (endpoint as uri's) ● Payload Agnostic ● No Container Dependency ● A lot of components 27 PUBLIC PRESENTATION | CLAUS IBSEN
  • 28. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● What's in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Extending Camel ● Q and A 28 PUBLIC PRESENTATION | CLAUS IBSEN
  • 29. A Little Example ● File Copier Example 29 PUBLIC PRESENTATION | CLAUS IBSEN
  • 30. A Little Example ● File Copier Example 30 PUBLIC PRESENTATION | CLAUS IBSEN
  • 31. A Little Example ● File Copier Example 31 PUBLIC PRESENTATION | CLAUS IBSEN
  • 32. A Little Example ● File Copier Example 32 PUBLIC PRESENTATION | CLAUS IBSEN
  • 33. A Little Example ● File Copier Example 33 PUBLIC PRESENTATION | CLAUS IBSEN
  • 34. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● What's in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Q and A 34 PUBLIC PRESENTATION | CLAUS IBSEN
  • 35. Riding Camel ● Downloading Apache Camel ● zip/tarball (approx 14mb) http://camel.apache.org 35 PUBLIC PRESENTATION | CLAUS IBSEN
  • 36. Riding Camel ● Using Command Shell ● Requires: Apache Maven ● From Eclipse 36 PUBLIC PRESENTATION | CLAUS IBSEN
  • 37. Riding Camel ● Console Example ● cd examples/camel-example-console ● mvn compile exec:java 37 PUBLIC PRESENTATION | CLAUS IBSEN
  • 38. Riding Camel ● Twitter Example ● cd examples/camel-example-twitter-websocket ● mvn compile exec:java http://localhost:9090/index.html 38 PUBLIC PRESENTATION | CLAUS IBSEN
  • 39. Riding Camel ● More examples ... ... and further details at website. http://camel.apache.org/examples 39 PUBLIC PRESENTATION | CLAUS IBSEN
  • 40. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● What's in the box? ● Deploying Camel ● Creating new Camel Projects ● Q and A 40 PUBLIC PRESENTATION | CLAUS IBSEN
  • 41. What's in the box? 41 PUBLIC PRESENTATION | CLAUS IBSEN
  • 42. What's in the box? ● Enterprise Integration Patterns http://camel.apache.org/eip 42 PUBLIC PRESENTATION | CLAUS IBSEN
  • 43. What's in the box? ● Splitter EIP 43 PUBLIC PRESENTATION | CLAUS IBSEN
  • 44. What is Apache Camel? 120+ Components 44 PUBLIC PRESENTATION | CLAUS IBSEN
  • 45. What is Apache Camel? 19 Data Formats 45 PUBLIC PRESENTATION | CLAUS IBSEN
  • 46. What is Apache Camel? 15 Expression Languages 46 PUBLIC PRESENTATION | CLAUS IBSEN
  • 47. What is Apache Camel? 5+ DSL in multiple languages ● Java DSL ● XML DSL (Spring and OSGi Blueprint) ● Groovy DSL ● Scala DSL ● Kotlin DSL (work in progress) 47 PUBLIC PRESENTATION | CLAUS IBSEN
  • 48. What is Apache Camel? Test Kit ● camel-test camel-test-spring ● camel-test-blueprint camel-testng 48 PUBLIC PRESENTATION | CLAUS IBSEN
  • 49. What is Apache Camel? Management ● JMX ● REST 49 PUBLIC PRESENTATION | CLAUS IBSEN
  • 50. What is Apache Camel? Tooling – Web console - HawtIO http://hawt.io 50 PUBLIC PRESENTATION | CLAUS IBSEN
  • 51. What is Apache Camel? Tooling – Eclipse Plugin – Fuse IDE http://github.com/fusesource/fuseide 51 PUBLIC PRESENTATION | CLAUS IBSEN
  • 52. What is Apache Camel? Error Handling 52 PUBLIC PRESENTATION | CLAUS IBSEN
  • 53. What is Apache Camel? try .. catch style 53 PUBLIC PRESENTATION | CLAUS IBSEN
  • 54. What is Apache Camel? Dead Letter Channel (EIP style) 54 PUBLIC PRESENTATION | CLAUS IBSEN
  • 55. What is Apache Camel? The Rest ● Interceptors ● Security ● Route Policy ● Type Converters ● Transaction ● Compensation as rollback ● Asynchronous non-blocking routing engine ● Thread management ● Maven Tooling ● ... and much more 55 PUBLIC PRESENTATION | CLAUS IBSEN
  • 56. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● What's in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Extending Camel ● Q and A 56 PUBLIC PRESENTATION | CLAUS IBSEN
  • 57. Deploying Camel ● Deployment Strategy ● No Container Dependency ● Lightweight & Embeddable ● Deployment Options ● Standalone ● WAR ● Spring ● JEE ● OSGi ● Cloud 57 PUBLIC PRESENTATION | CLAUS IBSEN
  • 58. Camel as a Client ● Java Client Application (no routes) ● Example ● Upload a file to a FTP server 58 PUBLIC PRESENTATION | CLAUS IBSEN
  • 59. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● What's in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Q and A 59 PUBLIC PRESENTATION | CLAUS IBSEN
  • 60. Creating new Camel Projects ● Using Command Shell ● From Eclipse 60 PUBLIC PRESENTATION | CLAUS IBSEN
  • 61. Creating new Camel Projects ● Maven Archetypes 61 PUBLIC PRESENTATION | CLAUS IBSEN
  • 62. Creating new Camel Projects ● camel-archetype-blueprint 62 PUBLIC PRESENTATION | CLAUS IBSEN
  • 63. Creating new Camel Projects ● Importing into Eclipse Existing Maven Project 63 PUBLIC PRESENTATION | CLAUS IBSEN
  • 64. Creating new Camel Projects ● Testing Camel Projects ● ... from inside Eclipse 64 PUBLIC PRESENTATION | CLAUS IBSEN
  • 65. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● What's in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Q and A 65 PUBLIC PRESENTATION | CLAUS IBSEN
  • 66. Where do I get more information? ● Best Article covering what Apache Camel is ● http://java.dzone.com/articles/open-source-integration- apache Link to article from “Getting Started” 66 PUBLIC PRESENTATION | CLAUS IBSEN
  • 67. Where do I get more information? ● Try Camel Examples ● http://camel.apache.org/examples.html ● Read other blogs and articles ● http://camel.apache.org/articles.html ● Use the “search box” on the Camel front page 67 PUBLIC PRESENTATION | CLAUS IBSEN
  • 68. Where do I get more information? ● Use the mailing list / forum ● http://camel.apache.org/mailing-lists.html ● Use stackoverflow ● http://stackoverflow.com/questions/tagged/apache-camel 68 PUBLIC PRESENTATION | CLAUS IBSEN
  • 69. Where do I get more information? ● Buy the Camel in Action book Use code ... camel40 … for 40% discount http://manning.com/ibsen/ 69 PUBLIC PRESENTATION | CLAUS IBSEN
  • 70. Any Questions ? ● Contact ● EMail: cibsen@redhat.com ● Twitter: @davsclaus ● Blog: http://davsclaus.com 70 PUBLIC PRESENTATION | CLAUS IBSEN