Upload
marut-singh
View
158
Download
1
Embed Size (px)
Citation preview
What does Camel stand for?
ConciseApplicationMessagingExchangeLanguage
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 apowerful Open SourceIntegration Frameworkbased on knownEnterprise 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
fromA
send toB
filtermessage
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[[email protected]==’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