SlideShare une entreprise Scribd logo
1  sur  22
Camel
as a Glue
Project. How we planned it
Project. How we imagine it.
Project. In practice.
Integration project. In practice.
How to handle it?
RTFM.
Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions
Specific tool
• Apache Camel
• Spring Integration
• Enterprise Service Bus (Mule ESB)




                                      Read article
Apache Camel. Pros.
Pros
• Lighweight
• A lot components
• Support many Data Formats
• Good community
• DSL(XML, Java, Scala, Groovy)
• Spring integration
Apache Camel. Cons.
• Messy documentations
Basic example. XML DSL
camel-config.xml
<camelContext>
………………………………………………….
    <route>
        <from uri="servlet:///my_url" />
        <bean ref=“urlHandler” method=“handle" />
        <transform>
        <constant>DONE</constant>
        </transform>
    </route>
………………………………………………….
</camelContext>
Basic example. JAVA DSL
 public class MyRouteBuilder extends RouteBuilder{
     public void configure() { from(" servlet:///my_url ").
       process(new UrlHandler()).to("direct:b");
     }
};
Or
public class MyRouteBuilder extends RouteBuilder{
     public void configure() { from(" servlet:///my_url ").
       processRef(“urlHandler”).to("direct:b");
     }
};
Processor
@Component(“urlHandler”)
public class UrlHandler{
  public void handle(Exchange ex){
      ex.getIn();
      //handle input
  }
}
More complex example
<route>
  <from uri="activemq:queue:queueName" />
  <unmarshal ref="xstream-utf8" />
  <bean ref=“firstProcessor" method="process" />
  <bean ref=“secondProcessor" method="process" />
…………………………………………………………………………………….
  <bean ref=“lastProcessor" method="process" />
  <to uri="direct:anotherRoute" />
</route>
Components
•   Amazon stack
•    Apache stack(service miz, fop, cxf,)
•   DBs(jdbc, jpa, ibatis)
•   EJB
•   File(ftp, ftps, file, hdfs)
•   Google stack(gae, guice, gmail, gtask)
•   Hazelcast
•   JMS
•   JMX
•   Mail (IMAP, POP)
•   Queues
•   Twitter
•   Many others
Components example
To poll, every 5 sec., all statuses on your home timeline
  and send to gmail:
Java DSL
from("twitter://timeline/home?type=polling&delay=5&consumerKey=[s]&co
   nsumerSecret=[s]&accessToken=[s]&accessTokenSecret=[s]").to("gmail://a
   ccount1@gmail.com")
XML DSL
<route>
   <from
   uri="twitter://timeline/home?type=polling&delay=5&consumerKey=[s]&c
   onsumerSecret=[s]&accessToken=[s]&accessTokenSecret=[s]"/>
   <to uri=" gmail://account1@gmail.com "/>
</route>
Data Formats
•   Standard java serialization
•   Object marshalling (json, protobuf)
•   Object xml marshalling (xstream, jaxb, jixb, castor, xmlbeans
•   Object/XML/Webservice marshalling (SOAP)
•   Direct JSON / XML marshalling
•   Flat data structure marshalling (BeanIO, bindy, csv, edi, flatpack
    dataformat)
•   Domain specific marshalling (HL7)
•   Compression (gzip, zip)
•   Security (Crypto, PGP, XMLsecurity)
•   Misc (custom dataformat, rss, syslog, tidymarkup)
•   Dozer Type Conversion
Marshalling example
<route>
  <from uri="direct:start"/>
  <marshal ref="myJaxb"/>
  <to uri="direct:marshalled"/>
</route>
<route>
  <from uri="direct:marshalled"/>
  <unmarshal ref="myJaxb"/>
  <to uri="mock:result"/>
</route>
EIP
• Dynamic Router

• Recipient List

• Message Filter

•   Wire Tap
•   Throttler
•   Load Balancer
•   Multicast
•   Others
Summary
Questions?

Contenu connexe

Tendances

Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014
Andrey Listochkin
 
Ch. 13 filters and wrappers
Ch. 13 filters and wrappersCh. 13 filters and wrappers
Ch. 13 filters and wrappers
Manolis Vavalis
 
REST vs SOAP
REST vs SOAPREST vs SOAP
REST vs SOAP
javicid
 

Tendances (20)

Mule xml java
Mule xml javaMule xml java
Mule xml java
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
 
Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Database
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
REST principle & Playframework Routes
REST principle & Playframework RoutesREST principle & Playframework Routes
REST principle & Playframework Routes
 
Map in Mule
Map in MuleMap in Mule
Map in Mule
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEREST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
 
Ch. 13 filters and wrappers
Ch. 13 filters and wrappersCh. 13 filters and wrappers
Ch. 13 filters and wrappers
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Groovy example in mule
Groovy example in muleGroovy example in mule
Groovy example in mule
 
Intro to RESTFul API's with ColdBox MVC
Intro to RESTFul API's with ColdBox MVCIntro to RESTFul API's with ColdBox MVC
Intro to RESTFul API's with ColdBox MVC
 
Difference between cxf Proxy_and cxf_jaxws
Difference between cxf Proxy_and cxf_jaxwsDifference between cxf Proxy_and cxf_jaxws
Difference between cxf Proxy_and cxf_jaxws
 
Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014
 
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophy
 
REST vs SOAP
REST vs SOAPREST vs SOAP
REST vs SOAP
 
Mule flow complete
Mule flow completeMule flow complete
Mule flow complete
 

En vedette (13)

Gwt
GwtGwt
Gwt
 
Measuring Financial Performance Based on Camels Rating
Measuring Financial Performance Based on Camels RatingMeasuring Financial Performance Based on Camels Rating
Measuring Financial Performance Based on Camels Rating
 
PRESENTATION - BAL CAMEL ANALYSIS
PRESENTATION - BAL CAMEL ANALYSISPRESENTATION - BAL CAMEL ANALYSIS
PRESENTATION - BAL CAMEL ANALYSIS
 
Camels rating
Camels ratingCamels rating
Camels rating
 
Camels rating system
Camels rating systemCamels rating system
Camels rating system
 
camel model
camel modelcamel model
camel model
 
Bank analysis and rating using the CAMEL model
Bank analysis and rating using the CAMEL modelBank analysis and rating using the CAMEL model
Bank analysis and rating using the CAMEL model
 
KPI and CAMEL analysis of axis and idbi bank
KPI and CAMEL analysis of axis and idbi bankKPI and CAMEL analysis of axis and idbi bank
KPI and CAMEL analysis of axis and idbi bank
 
Camels approach
Camels approachCamels approach
Camels approach
 
Camel ratings ppt
Camel ratings pptCamel ratings ppt
Camel ratings ppt
 
Camels Modeling
Camels ModelingCamels Modeling
Camels Modeling
 
Camels Rating
Camels RatingCamels Rating
Camels Rating
 
CAMELS MODEL Analysis on Banking Sector.
CAMELS MODEL Analysis on Banking Sector.CAMELS MODEL Analysis on Banking Sector.
CAMELS MODEL Analysis on Banking Sector.
 

Similaire à Camel as a_glue

#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMixEasy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
elliando dias
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
01 apache camel-intro
01 apache camel-intro01 apache camel-intro
01 apache camel-intro
RedpillLinpro
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
b_kathir
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
Gavin Roy
 

Similaire à Camel as a_glue (20)

Knolx session
Knolx sessionKnolx session
Knolx session
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Global Scale ESB with Mule
Global Scale ESB with MuleGlobal Scale ESB with Mule
Global Scale ESB with Mule
 
EIP In Practice
EIP In PracticeEIP In Practice
EIP In Practice
 
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMixEasy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
 
GDG Almaty Meetup: Reactive full-stack .NET web applications with WebSharper
GDG Almaty Meetup: Reactive full-stack .NET web applications with WebSharperGDG Almaty Meetup: Reactive full-stack .NET web applications with WebSharper
GDG Almaty Meetup: Reactive full-stack .NET web applications with WebSharper
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Aimaf
AimafAimaf
Aimaf
 
01 apache camel-intro
01 apache camel-intro01 apache camel-intro
01 apache camel-intro
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShift
 
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShiftReal-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
 
The rise of Polymer and Web Components (Kostas Karolemeas) - GreeceJS #17
The rise of Polymer and Web Components (Kostas Karolemeas) - GreeceJS #17The rise of Polymer and Web Components (Kostas Karolemeas) - GreeceJS #17
The rise of Polymer and Web Components (Kostas Karolemeas) - GreeceJS #17
 
Google Polymer Framework
Google Polymer FrameworkGoogle Polymer Framework
Google Polymer Framework
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop Labs
 
Reitit - Clojure/North 2019
Reitit - Clojure/North 2019Reitit - Clojure/North 2019
Reitit - Clojure/North 2019
 

Dernier

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Dernier (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

Camel as a_glue

  • 2. Project. How we planned it
  • 3. Project. How we imagine it.
  • 7.
  • 8. RTFM. Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions
  • 9. Specific tool • Apache Camel • Spring Integration • Enterprise Service Bus (Mule ESB) Read article
  • 10. Apache Camel. Pros. Pros • Lighweight • A lot components • Support many Data Formats • Good community • DSL(XML, Java, Scala, Groovy) • Spring integration
  • 11. Apache Camel. Cons. • Messy documentations
  • 12. Basic example. XML DSL camel-config.xml <camelContext> …………………………………………………. <route> <from uri="servlet:///my_url" /> <bean ref=“urlHandler” method=“handle" /> <transform> <constant>DONE</constant> </transform> </route> …………………………………………………. </camelContext>
  • 13. Basic example. JAVA DSL public class MyRouteBuilder extends RouteBuilder{ public void configure() { from(" servlet:///my_url "). process(new UrlHandler()).to("direct:b"); } }; Or public class MyRouteBuilder extends RouteBuilder{ public void configure() { from(" servlet:///my_url "). processRef(“urlHandler”).to("direct:b"); } };
  • 14. Processor @Component(“urlHandler”) public class UrlHandler{ public void handle(Exchange ex){ ex.getIn(); //handle input } }
  • 15. More complex example <route> <from uri="activemq:queue:queueName" /> <unmarshal ref="xstream-utf8" /> <bean ref=“firstProcessor" method="process" /> <bean ref=“secondProcessor" method="process" /> ……………………………………………………………………………………. <bean ref=“lastProcessor" method="process" /> <to uri="direct:anotherRoute" /> </route>
  • 16. Components • Amazon stack • Apache stack(service miz, fop, cxf,) • DBs(jdbc, jpa, ibatis) • EJB • File(ftp, ftps, file, hdfs) • Google stack(gae, guice, gmail, gtask) • Hazelcast • JMS • JMX • Mail (IMAP, POP) • Queues • Twitter • Many others
  • 17. Components example To poll, every 5 sec., all statuses on your home timeline and send to gmail: Java DSL from("twitter://timeline/home?type=polling&delay=5&consumerKey=[s]&co nsumerSecret=[s]&accessToken=[s]&accessTokenSecret=[s]").to("gmail://a ccount1@gmail.com") XML DSL <route> <from uri="twitter://timeline/home?type=polling&delay=5&consumerKey=[s]&c onsumerSecret=[s]&accessToken=[s]&accessTokenSecret=[s]"/> <to uri=" gmail://account1@gmail.com "/> </route>
  • 18. Data Formats • Standard java serialization • Object marshalling (json, protobuf) • Object xml marshalling (xstream, jaxb, jixb, castor, xmlbeans • Object/XML/Webservice marshalling (SOAP) • Direct JSON / XML marshalling • Flat data structure marshalling (BeanIO, bindy, csv, edi, flatpack dataformat) • Domain specific marshalling (HL7) • Compression (gzip, zip) • Security (Crypto, PGP, XMLsecurity) • Misc (custom dataformat, rss, syslog, tidymarkup) • Dozer Type Conversion
  • 19. Marshalling example <route> <from uri="direct:start"/> <marshal ref="myJaxb"/> <to uri="direct:marshalled"/> </route> <route> <from uri="direct:marshalled"/> <unmarshal ref="myJaxb"/> <to uri="mock:result"/> </route>
  • 20. EIP • Dynamic Router • Recipient List • Message Filter • Wire Tap • Throttler • Load Balancer • Multicast • Others