What does Camel stand for?
Concise
Application
Messaging
Exchange
Language
About Me
 12 years in Software Industry
 Build software in Project Management, CAD/CAM, Banking, Education,
Ecommerce
 C++,C #.Net, Java, Scala, Akka, Spring, Node.JS, Vert.x, RDBMS, MongoDB
 www.Marutsingh.com
What is Apache Camel
 Quote from the web site
 http://camel.apache.org
Apache Camel is a
powerful Open Source
Integration Framework
based on known
Enterprise Integration Patterns
What is Apache Camel
 Why do we need integration?
 Your apps are build using different tech stacks
 Critical for your business to integrate
 Why Integration Framework?
 Framework do the heavy lifting
 Focus on business problem
 Not "reinventing the wheel"
What is Apache Camel
 What is Enterprise Integration Patterns?
What is Apache Camel
 Use Case
ActiveMQ REST Api
What is Apache Camel
 What is Enterprise Integration Patterns?
EIP
 Filter Pattern
from
A
send to
B
filter
message
Camel’s architecture
Filter Route
Endpoint A =
endpoint("activemq:queue:quote");
Endpoint B = endpoint("mq:quote");
Predicate isWidget =
xpath("/quote/product = ‘widget’");
from(A).filter(isWidget).to(B);
Filter Route
import org.apache.camel.builder.RouteBuilder;
public class FilterRoute extends RouteBuilder {
public void configure() throws Exception {
Endpoint A = endpoint("activemq:queue:order");
Endpoint B = endpoint("mq:inventory");
Predicate isWidget = xpath("/quote/product = ‘widget’");
from(A).filter(isWidget).to(B);
}
}
Content Based Router
Content Based Route – Java DSL
from("activemq:orders")
.choice()
.when() .jsonpath(“$..order[?@.type==’cod’)]”)
.to("activemq:codOrders")
.otherwise()
.to("activemq:prepaidOrders");
Camel Components
 Summary
 Integration framework
 > 180 components out of the box
 Enterprise Integration Patterns (EIP)
 Routing and mediation
 Domain Specific Language (DSL)
 Endpoints as URIs
 Predicate and Expressions
 Very extensible and configurable
 No heavy specification
 No container dependency
 Payload agnostic
 Connectivity to a great wealth of transports
 Apache licensed
Code Example
 Goals
1) Pickup files from a directory
2) Make sure we only pickup 3 files per 30 seconds
3) Store into JMS queue
4) Listen on JMS queue
5) And upload file to FTP server
Goals using Enterprise Integration Patterns
from throttle to from to

Apache camel

  • 2.
    What does Camelstand for? Concise Application Messaging Exchange Language
  • 3.
    About Me  12years in Software Industry  Build software in Project Management, CAD/CAM, Banking, Education, Ecommerce  C++,C #.Net, Java, Scala, Akka, Spring, Node.JS, Vert.x, RDBMS, MongoDB  www.Marutsingh.com
  • 4.
    What is ApacheCamel  Quote from the web site  http://camel.apache.org Apache Camel is a powerful Open Source Integration Framework based on known Enterprise Integration Patterns
  • 5.
    What is ApacheCamel  Why do we need integration?  Your apps are build using different tech stacks  Critical for your business to integrate  Why Integration Framework?  Framework do the heavy lifting  Focus on business problem  Not "reinventing the wheel"
  • 6.
    What is ApacheCamel  What is Enterprise Integration Patterns?
  • 7.
    What is ApacheCamel  Use Case ActiveMQ REST Api
  • 8.
    What is ApacheCamel  What is Enterprise Integration Patterns?
  • 9.
  • 10.
     Filter Pattern from A sendto B filter message
  • 12.
  • 13.
    Filter Route Endpoint A= endpoint("activemq:queue:quote"); Endpoint B = endpoint("mq:quote"); Predicate isWidget = xpath("/quote/product = ‘widget’"); from(A).filter(isWidget).to(B);
  • 14.
    Filter Route import org.apache.camel.builder.RouteBuilder; publicclass FilterRoute extends RouteBuilder { public void configure() throws Exception { Endpoint A = endpoint("activemq:queue:order"); Endpoint B = endpoint("mq:inventory"); Predicate isWidget = xpath("/quote/product = ‘widget’"); from(A).filter(isWidget).to(B); } }
  • 15.
  • 16.
    Content Based Route– Java DSL from("activemq:orders") .choice() .when() .jsonpath(“$..order[?@.type==’cod’)]”) .to("activemq:codOrders") .otherwise() .to("activemq:prepaidOrders");
  • 17.
  • 18.
     Summary  Integrationframework  > 180 components out of the box  Enterprise Integration Patterns (EIP)  Routing and mediation  Domain Specific Language (DSL)  Endpoints as URIs  Predicate and Expressions  Very extensible and configurable  No heavy specification  No container dependency  Payload agnostic  Connectivity to a great wealth of transports  Apache licensed
  • 19.
    Code Example  Goals 1)Pickup files from a directory 2) Make sure we only pickup 3 files per 30 seconds 3) Store into JMS queue 4) Listen on JMS queue 5) And upload file to FTP server
  • 20.
    Goals using EnterpriseIntegration Patterns from throttle to from to