0
Getting Started with Apache Camel    Claus Ibsen (@davsclaus)    Principal Software Engineer, Red Hat    Javaforum Malmo, ...
Agenda    ●   What is Apache Camel?    ●   A little Example    ●   Riding Camel    ●   Whats in the Camel box?    ●   Depl...
Your Speaker    ●   Principal Software Engineer at Red Hat    ●   Apache Camel         ●   5 years working with Camel    ●...
What is Apache Camel?    ●   Quote from the website4                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?    ●   Why do we need integration?         ●   Critical for your business to integrate    ●   Why In...
What is Apache Camel?    ●   What is Enterprise Integration Patterns?                          Its a book6                ...
What is Apache Camel?    ●   Enterprise Integration Patterns                   http://camel.apache.org/eip7               ...
What is Apache Camel?    ●   EIP - Content Based Router8                         PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?    from newOrder9                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     from newOrder       choice10                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     from newOrder       choice         when isWidget to widget11                   PUBLIC PRESENTATI...
What is Apache Camel?     from newOrder       choice         when isWidget to widget         otherwise to gadget12        ...
What is Apache Camel?     from(newOrder)       choice         when(isWidget) to(widget)         otherwise to(gadget)13    ...
What is Apache Camel?     from(newOrder)       .choice()         .when(isWidget).to(widget)         .otherwise().to(gadget...
What is Apache Camel?     Endpoint newOrder = endpoint("activemq:queue:newOrder");     from(newOrder)       .choice()     ...
What is Apache Camel?     Endpoint newOrder = endpoint("activemq:queue:newOrder");     Predicate isWidget = xpath("/order/...
What is Apache Camel?     Endpoint newOrder = endpoint("activemq:queue:newOrder");     Predicate isWidget = xpath("/order/...
What is Apache Camel? ●   Java Code        public void configure() throws Exception {          Endpoint newOrder = endpoin...
What is Apache Camel? ●   Java Code       import org.apache.camel.Endpoint;       import org.apache.camel.Predicate;      ...
What is Apache Camel? ●   Camel Java DSL       import org.apache.camel.builder.RouteBuilder;       public class MyRoute ex...
What is Apache Camel? ●   Camel XML DSL        <route>          <from uri="activemq:queue:newOrder"/>          <choice>   ...
What is Apache Camel?                                          use file instead ●   Endpoint as URIs        <route>       ...
What is Apache Camel?                                                               parameters ●   Endpoint as URIs       ...
What is Apache Camel? ●   Camels Architecture24                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     120+ Components25                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     120+ Components26                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel? ●   Summary     ●   Integration Framework     ●   Enterprise Integration Patterns (EIP)     ●   Rout...
Agenda ●   What is Apache Camel? ●   A little Example ●   Riding Camel ●   Whats in the Camel box? ●   Deploying Camel ●  ...
A Little Example ●   File Copier Example29                     PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example ●   File Copier Example30                     PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example ●   File Copier Example31                     PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example ●   File Copier Example32                     PUBLIC PRESENTATION | CLAUS IBSEN
A Little Example ●   File Copier Example33                     PUBLIC PRESENTATION | CLAUS IBSEN
Agenda ●   What is Apache Camel? ●   A little Example ●   Riding Camel ●   Whats in the Camel box? ●   Deploying Camel ●  ...
Riding Camel ●   Downloading Apache Camel     ●   zip/tarball (approx 14mb)                                               ...
Riding Camel ●   Using Command Shell      ●   Requires: Apache Maven ●   From Eclipse36                       PUBLIC PRESE...
Riding Camel ●   Console Example ●   cd examples/camel-example-console ●   mvn compile exec:java37                     PUB...
Riding Camel ●   Twitter Example ●   cd examples/camel-example-twitter-websocket ●   mvn compile exec:java                ...
Riding Camel ●   More examples ...     ... and further details at website.                http://camel.apache.org/examples...
Agenda ●   What is Apache Camel? ●   A little Example ●   Riding Camel ●   Whats in the box? ●   Deploying Camel ●   Creat...
Whats in the box?41                   PUBLIC PRESENTATION | CLAUS IBSEN
Whats in the box? ●   Enterprise Integration Patterns                http://camel.apache.org/eip42                     PUB...
Whats in the box? ●   Splitter EIP43                   PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     120+ Components44                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     19 Data Formats45                     PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     15 Expression Languages46                    PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     5+ DSL in multiple languages      ●   Java DSL      ●   XML DSL (Spring and OSGi Blueprint)     ...
What is Apache Camel?     Test Kit      ●   camel-test                      camel-test-spring      ●   camel-test-blueprin...
What is Apache Camel?     Management     ●   JMX     ●   REST49                PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     Tooling – Web console - HawtIO                       http://hawt.io50                     PUBLIC...
What is Apache Camel?     Tooling – Eclipse Plugin – Fuse IDE              http://github.com/fusesource/fuseide51         ...
What is Apache Camel?     Error Handling52                    PUBLIC PRESENTATION | CLAUS IBSEN
What is Apache Camel?     try .. catch style53                        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     ...
Agenda ●   What is Apache Camel? ●   A little Example ●   Riding Camel ●   Whats in the Camel box? ●   Deploying Camel ●  ...
Deploying Camel ●   Deployment Strategy     ●   No Container Dependency     ●   Lightweight & Embeddable ●   Deployment Op...
Camel as a Client ●   Java Client Application (no routes) ●   Example      ●   Upload a file to a FTP server58            ...
Agenda ●   What is Apache Camel? ●   A little Example ●   Riding Camel ●   Whats in the Camel box? ●   Deploying Camel ●  ...
Creating new Camel Projects ●   Using Command Shell ●   From Eclipse60                   PUBLIC PRESENTATION | CLAUS IBSEN
Creating new Camel Projects ●   Maven Archetypes61                      PUBLIC PRESENTATION | CLAUS IBSEN
Creating new Camel Projects ●   camel-archetype-blueprint62                     PUBLIC PRESENTATION | CLAUS IBSEN
Creating new Camel Projects ●   Importing into Eclipse                                                       Existing Mave...
Creating new Camel Projects ●   Testing Camel Projects ●   ... from inside Eclipse64                       PUBLIC PRESENTA...
Agenda ●   What is Apache Camel? ●   A little Example ●   Riding Camel ●   Whats in the Camel box? ●   Deploying Camel ●  ...
Where do I get more information? ●   Best Article covering what Apache Camel is      ●   http://java.dzone.com/articles/op...
Where do I get more information? ●   Try Camel Examples      ●   http://camel.apache.org/examples.html ●   Read other blog...
Where do I get more information? ●   Use the mailing list / forum      ●   http://camel.apache.org/mailing-lists.html ●   ...
Where do I get more information? ●   Buy the Camel in Action book                                                         ...
Any Questions ?●    Contact      ● EMail: cibsen@redhat.com      ● Twitter: @davsclaus      ● Blog: http://davsclaus.com  ...
Upcoming SlideShare
Loading in...5
×

Getting Started with Apache Camel - Malmo JUG - March 2013

1,178

Published on

This session will teach you how to get a good start with Apache Camel.

We will introduce you to Apache Camel and how Camel its related to Enterprise Integration Patterns. And how you go about using these patterns in Camel routes, written in Java code or XML files.

We will then discuss how you can get started developing with Camel, and how to setup a new project from scratch using Maven and Eclipse tooling.

This session includes live demos that show how to build Camel applications in Java, Spring, OSGi Blueprint and alternative languages such as Scala and Groovy.

You will also hear what other features Camel provides out of the box, which can make integration much easier for you.

At the end we demonstrate how to build custom components, allowing you to build custom adapters if not already provided by Camel.

Before opening up for QA, we will share useful links where you can dive into learning more about Camel.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,178
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
28
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Getting Started with Apache Camel - Malmo JUG - March 2013"

  1. 1. Getting Started with Apache Camel Claus Ibsen (@davsclaus) Principal Software Engineer, Red Hat Javaforum Malmo, march 20131 PUBLIC PRESENTATION | CLAUS IBSEN
  2. 2. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● Whats in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Q and A2 PUBLIC PRESENTATION | CLAUS IBSEN
  3. 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.com3 PUBLIC PRESENTATION | CLAUS IBSEN
  4. 4. What is Apache Camel? ● Quote from the website4 PUBLIC PRESENTATION | CLAUS IBSEN
  5. 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. 6. What is Apache Camel? ● What is Enterprise Integration Patterns? Its a book6 PUBLIC PRESENTATION | CLAUS IBSEN
  7. 7. What is Apache Camel? ● Enterprise Integration Patterns http://camel.apache.org/eip7 PUBLIC PRESENTATION | CLAUS IBSEN
  8. 8. What is Apache Camel? ● EIP - Content Based Router8 PUBLIC PRESENTATION | CLAUS IBSEN
  9. 9. What is Apache Camel? from newOrder9 PUBLIC PRESENTATION | CLAUS IBSEN
  10. 10. What is Apache Camel? from newOrder choice10 PUBLIC PRESENTATION | CLAUS IBSEN
  11. 11. What is Apache Camel? from newOrder choice when isWidget to widget11 PUBLIC PRESENTATION | CLAUS IBSEN
  12. 12. What is Apache Camel? from newOrder choice when isWidget to widget otherwise to gadget12 PUBLIC PRESENTATION | CLAUS IBSEN
  13. 13. What is Apache Camel? from(newOrder) choice when(isWidget) to(widget) otherwise to(gadget)13 PUBLIC PRESENTATION | CLAUS IBSEN
  14. 14. What is Apache Camel? from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget);14 PUBLIC PRESENTATION | CLAUS IBSEN
  15. 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. 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. 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. 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. 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. 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. 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. 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. 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. 24. What is Apache Camel? ● Camels Architecture24 PUBLIC PRESENTATION | CLAUS IBSEN
  25. 25. What is Apache Camel? 120+ Components25 PUBLIC PRESENTATION | CLAUS IBSEN
  26. 26. What is Apache Camel? 120+ Components26 PUBLIC PRESENTATION | CLAUS IBSEN
  27. 27. What is Apache Camel? ● Summary ● Integration Framework ● Enterprise Integration Patterns (EIP) ● Routing (using DSL) ● Easy Configuration (endpoint as uris) ● Payload Agnostic ● No Container Dependency ● A lot of components27 PUBLIC PRESENTATION | CLAUS IBSEN
  28. 28. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● Whats in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Extending Camel ● Q and A28 PUBLIC PRESENTATION | CLAUS IBSEN
  29. 29. A Little Example ● File Copier Example29 PUBLIC PRESENTATION | CLAUS IBSEN
  30. 30. A Little Example ● File Copier Example30 PUBLIC PRESENTATION | CLAUS IBSEN
  31. 31. A Little Example ● File Copier Example31 PUBLIC PRESENTATION | CLAUS IBSEN
  32. 32. A Little Example ● File Copier Example32 PUBLIC PRESENTATION | CLAUS IBSEN
  33. 33. A Little Example ● File Copier Example33 PUBLIC PRESENTATION | CLAUS IBSEN
  34. 34. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● Whats in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Q and A34 PUBLIC PRESENTATION | CLAUS IBSEN
  35. 35. Riding Camel ● Downloading Apache Camel ● zip/tarball (approx 14mb) http://camel.apache.org35 PUBLIC PRESENTATION | CLAUS IBSEN
  36. 36. Riding Camel ● Using Command Shell ● Requires: Apache Maven ● From Eclipse36 PUBLIC PRESENTATION | CLAUS IBSEN
  37. 37. Riding Camel ● Console Example ● cd examples/camel-example-console ● mvn compile exec:java37 PUBLIC PRESENTATION | CLAUS IBSEN
  38. 38. Riding Camel ● Twitter Example ● cd examples/camel-example-twitter-websocket ● mvn compile exec:java http://localhost:9090/index.html38 PUBLIC PRESENTATION | CLAUS IBSEN
  39. 39. Riding Camel ● More examples ... ... and further details at website. http://camel.apache.org/examples39 PUBLIC PRESENTATION | CLAUS IBSEN
  40. 40. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● Whats in the box? ● Deploying Camel ● Creating new Camel Projects ● Q and A40 PUBLIC PRESENTATION | CLAUS IBSEN
  41. 41. Whats in the box?41 PUBLIC PRESENTATION | CLAUS IBSEN
  42. 42. Whats in the box? ● Enterprise Integration Patterns http://camel.apache.org/eip42 PUBLIC PRESENTATION | CLAUS IBSEN
  43. 43. Whats in the box? ● Splitter EIP43 PUBLIC PRESENTATION | CLAUS IBSEN
  44. 44. What is Apache Camel? 120+ Components44 PUBLIC PRESENTATION | CLAUS IBSEN
  45. 45. What is Apache Camel? 19 Data Formats45 PUBLIC PRESENTATION | CLAUS IBSEN
  46. 46. What is Apache Camel? 15 Expression Languages46 PUBLIC PRESENTATION | CLAUS IBSEN
  47. 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. 48. What is Apache Camel? Test Kit ● camel-test camel-test-spring ● camel-test-blueprint camel-testng48 PUBLIC PRESENTATION | CLAUS IBSEN
  49. 49. What is Apache Camel? Management ● JMX ● REST49 PUBLIC PRESENTATION | CLAUS IBSEN
  50. 50. What is Apache Camel? Tooling – Web console - HawtIO http://hawt.io50 PUBLIC PRESENTATION | CLAUS IBSEN
  51. 51. What is Apache Camel? Tooling – Eclipse Plugin – Fuse IDE http://github.com/fusesource/fuseide51 PUBLIC PRESENTATION | CLAUS IBSEN
  52. 52. What is Apache Camel? Error Handling52 PUBLIC PRESENTATION | CLAUS IBSEN
  53. 53. What is Apache Camel? try .. catch style53 PUBLIC PRESENTATION | CLAUS IBSEN
  54. 54. What is Apache Camel? Dead Letter Channel (EIP style)54 PUBLIC PRESENTATION | CLAUS IBSEN
  55. 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 more55 PUBLIC PRESENTATION | CLAUS IBSEN
  56. 56. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● Whats in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Extending Camel ● Q and A56 PUBLIC PRESENTATION | CLAUS IBSEN
  57. 57. Deploying Camel ● Deployment Strategy ● No Container Dependency ● Lightweight & Embeddable ● Deployment Options ● Standalone ● WAR ● Spring ● JEE ● OSGi ● Cloud57 PUBLIC PRESENTATION | CLAUS IBSEN
  58. 58. Camel as a Client ● Java Client Application (no routes) ● Example ● Upload a file to a FTP server58 PUBLIC PRESENTATION | CLAUS IBSEN
  59. 59. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● Whats in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Q and A59 PUBLIC PRESENTATION | CLAUS IBSEN
  60. 60. Creating new Camel Projects ● Using Command Shell ● From Eclipse60 PUBLIC PRESENTATION | CLAUS IBSEN
  61. 61. Creating new Camel Projects ● Maven Archetypes61 PUBLIC PRESENTATION | CLAUS IBSEN
  62. 62. Creating new Camel Projects ● camel-archetype-blueprint62 PUBLIC PRESENTATION | CLAUS IBSEN
  63. 63. Creating new Camel Projects ● Importing into Eclipse Existing Maven Project63 PUBLIC PRESENTATION | CLAUS IBSEN
  64. 64. Creating new Camel Projects ● Testing Camel Projects ● ... from inside Eclipse64 PUBLIC PRESENTATION | CLAUS IBSEN
  65. 65. Agenda ● What is Apache Camel? ● A little Example ● Riding Camel ● Whats in the Camel box? ● Deploying Camel ● Creating new Camel Projects ● Q and A65 PUBLIC PRESENTATION | CLAUS IBSEN
  66. 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. 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 page67 PUBLIC PRESENTATION | CLAUS IBSEN
  68. 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-camel68 PUBLIC PRESENTATION | CLAUS IBSEN
  69. 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. 70. Any Questions ?● Contact ● EMail: cibsen@redhat.com ● Twitter: @davsclaus ● Blog: http://davsclaus.com 70 PUBLIC PRESENTATION | CLAUS IBSEN
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×