SlideShare uma empresa Scribd logo
1 de 50
Apache Camel Taking Camel for a ride Hands on Xke Alexis Kinsella June 11, 2010
www.xebia.fr / blog.xebia.fr What is camel ?
What is camel ? www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object]
What is camel ? ,[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
What is camel ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
www.xebia.fr / blog.xebia.fr Some informations before you start ...
About the authors (Camel Riders) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
About the authors (Camel Riders) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Camel and friends ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Professionnal Camel Support ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Competitors and Families of products ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Camel compared to Mule ... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Camel compared to Mule ... ,[object Object],[object Object],www.xebia.fr / blog.xebia.fr
www.xebia.fr / blog.xebia.fr The basics
Message Routing www.xebia.fr / blog.xebia.fr Endpoint B Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint A Message
Camel Components www.xebia.fr / blog.xebia.fr
Kick Ass features ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Simple Routing www.xebia.fr / blog.xebia.fr Endpoint B Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint A Message File Jms
Pipeline www.xebia.fr / blog.xebia.fr Endpoint B Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint A Message Endpoint C Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint D Message Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget
Multicast www.xebia.fr / blog.xebia.fr Endpoint B Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint A Message Endpoint B Endpoint B File IBatis SMTP SFTP
Message filter: Spring XML www.xebia.fr / blog.xebia.fr <? xml  version = &quot;1.0&quot;  encoding = &quot;UTF-8&quot; ?> < beans  xmlns = &quot;http://www.springframework.org/schema/beans&quot; xmlns:xsi = &quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:schemaLocation = &quot;…&quot; > < camelContext  xmlns = &quot;http://activemq.apache.org/camel/schema/spring&quot; > < route > < from  uri = &quot;activemq:topic:Quotes&quot;  /> < filter > < xpath > /quote/product = ‘widget’ </ xpath > < to  uri = &quot;mqseries:WidgetQuotes&quot;  /> </ filter > </ route > </ camelContext > </ beans >
Message filter: Java DSL www.xebia.fr / blog.xebia.fr package  com.acme.quotes; import  org.apache.camel.builder.RouteBuilder; public   class  MyRouteBuilder  extends  RouteBuilder { public   void  configure() { // forward widget quotes to MQSeries from( &quot;activemq:topic:Quotes&quot; ). filter().xpath( &quot;/quote/product = ‘widget’&quot; ). to( &quot;mqseries:WidgetQuotes&quot; ); } }
Content Based Router: Java www.xebia.fr / blog.xebia.fr from( &quot;activemq:NewOrders&quot; ). choice().when().xpath( &quot;/quote/product = 'widget'&quot; ). to( &quot;activemq:Orders.Widgets&quot; ). choice().when().xpath( &quot;/quote/product = 'gadget'&quot; ). to( &quot;activemq:Orders.Gadgets&quot; ). otherwise(). to( &quot;activemq:Orders.Bad&quot; );
Content Based Router: Spring XML www.xebia.fr / blog.xebia.fr <? xml  version = &quot;1.0&quot;  encoding = &quot;UTF-8&quot; ?> < beans  xmlns = &quot;http://www.springframework.org/schema/beans&quot; xmlns:xsi = &quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:schemaLocation = &quot;...&quot; > < camelContext  xmlns = &quot;http://activemq.apache.org/camel/schema/spring&quot; > < route > < from  uri = &quot;activemq:NewOrders&quot;  /> < choice > < when > < xpath > /order/product = 'widget' </ xpath > < to  uri = &quot;activemq:Orders.Widgets&quot;  /> </ when > < when > < xpath > /order/product = 'gadget' </ xpath > < to  uri = &quot;activemq:Orders.Gadgets&quot;  /> </ when > < otherwise > < to  uri = &quot;activemq:Orders.Bad&quot;  /> </ otherwise > </ choice > </ route > </ camelContext > </ beans >
How camel do this routing work ? ,[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Message processors www.xebia.fr / blog.xebia.fr from( &quot;direct:start&quot; ).process( new  Processor() { public   void  process(Exchange exchange) { Message in = exchange.getIn(); in.setBody(in.getBody(String. class ) +  &quot; World!&quot; ); } }).to( &quot;mock:result&quot; ); < bean   id = &quot;myProcessor&quot;   class = &quot;com.acme.MyProcessor&quot; /> from( &quot;activemq:myQueue&quot; ).to( &quot;myProcessor&quot; ); ,[object Object],[object Object],[object Object]
Expressions www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Predicates www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Predicates examples www.xebia.fr / blog.xebia.fr from( &quot;jms:queue:order&quot; ) .choice() .when(header( &quot;type&quot; ).isEqualTo( &quot;widget&quot; )).to( &quot;bean:widgetOrder&quot; ) .when(header( &quot;type&quot; ).isEqualTo( &quot;wombat&quot; )).to( &quot;bean:wombatOrder&quot; ) .otherwise() .to( &quot;bean:miscOrder&quot; ) .end();  Predicate  isWidget  = header( &quot;type&quot; ).isEqualTo( &quot;widget&quot; ); from( &quot;jms:queue:order&quot; ) .choice() .when( isWidget ).to( &quot;bean:widgetOrder&quot; ) .when( isWombat ).to( &quot;bean:wombatOrder&quot; ) .otherwise() .to( &quot;bean:miscOrder&quot; ) .end();
Transaction Oriented Endpoints www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transaction Oriented Endpoints www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transaction Oriented Endpoints www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transaction Oriented Endpoints www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transaction Oriented Endpoints www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transaction Oriented Endpoints www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DefaultErrorHandler & DeadLetterChannel www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Annotation support www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
@Bean annotation www.xebia.fr / blog.xebia.fr public   class  Foo { @ MessageDriven ( uri  =  &quot;activemq:my.queue&quot; ) public   void  doSomething( @Bean ( &quot;myCorrelationIdGenerator&quot; ) String correlationID,  @Body  String body) { // process the  inbound  message here } } public   class  MyIdGenerator { private   UserManager   userManager ; public  String generate( @ Header ( name  =  &quot;user&quot; ) String user,  @Body  String payload)  throws  Exception { User   user  =  userManager .lookupUser(user); String id = user.getPrimaryId() +  generateHashCodeForPayload (payload); return  id; } }
Groovy support www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Testing with camel www.xebia.fr / blog.xebia.fr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Testing with camel www.xebia.fr / blog.xebia.fr public   class  FilterTest  extends  CamelTestSupport { @EndpointInject (uri =  &quot;mock:result&quot; )  protected  MockEndpoint  resultEndpoint ; @Produce (uri =  &quot;direct:start&quot; )  protected  ProducerTemplate  template ; public   void  testSendMatchingMessage()  throws  Exception { String expectedBody =  &quot;<matched/>&quot; ; resultEndpoint .expectedBodiesReceived(expectedBody); template .sendBodyAndHeader(expectedBody,  &quot;foo&quot; ,  &quot;bar&quot; ); resultEndpoint .assertIsSatisfied(); } public   void  testSendNotMatchingMessage()  throws  Exception { resultEndpoint .expectedMessageCount(0); template .sendBodyAndHeader( &quot;<notMatched/>&quot; ,  &quot;foo&quot; ,  &quot;notMatchedHeaderValue&quot; ); resultEndpoint .assertIsSatisfied(); } @Override protected  RouteBuilder createRouteBuilder() { return   new  RouteBuilder() { public   void  configure() { from( &quot;direct:start&quot; ).filter(header( &quot;foo&quot; ).isEqualTo( &quot;bar&quot; )).to( &quot;mock:result&quot; ); } }; } }
Spring Test with Java Config www.xebia.fr / blog.xebia.fr @ ContextConfiguration (  locations  =  &quot;org.apache.camel.spring.javaconfig.patterns.FilterTest$ContextConfig&quot; ,  loader  =  JavaConfigContextLoader . class ) public   class  FilterTest  extends   AbstractJUnit4SpringContextTests  { @EndpointInject (uri =  &quot;mock:result&quot; )  protected  MockEndpoint  resultEndpoint ; @Produce (uri =  &quot;direct:start&quot; )  protected  ProducerTemplate  template ; @ DirtiesContext @Test public   void  testSendMatchingMessage()  throws  Exception { String expectedBody =  &quot;<matched/>&quot; ; resultEndpoint .expectedBodiesReceived(expectedBody); template .sendBodyAndHeader(expectedBody,  &quot;foo&quot; ,  &quot;bar&quot; ); resultEndpoint .assertIsSatisfied(); } @ Configuration public   static   class  ContextConfig  extends   SingleRouteCamelConfiguration  { @Bean public  RouteBuilder route() { return   new  RouteBuilder() { public   void  configure() { from( &quot;direct:start&quot; ).filter(header( &quot;foo&quot; ).isEqualTo( &quot;bar&quot; )).to( &quot;mock:result&quot; ); } }; } } }
Camel riding from Java ,[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Camel & Maven ,[object Object],[object Object],www.xebia.fr / blog.xebia.fr <? xml  version = &quot;1.0&quot;  encoding = &quot;UTF-8&quot; ?> < project > < build > < plugins > < plugin > < groupId > org.apache.camel </ groupId > < artifactId > camel- maven-plugin </ artifactId > </ plugin > </ plugins > </ build > < reporting > < plugins > < plugin > < groupId > org.apache.camel </ groupId > < artifactId > camel- maven-plugin </ artifactId > </ plugin > </ plugins > </ reporting > </ project >  
Maven site report ,[object Object],www.xebia.fr / blog.xebia.fr
Where would I use Camel ? ,[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
www.xebia.fr / blog.xebia.fr Going further with Apache Camel …
Books ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
Books ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],www.xebia.fr / blog.xebia.fr
www.xebia.fr / blog.xebia.fr Twitter: @alexiskinsella Thank You

Mais conteúdo relacionado

Mais procurados

Rails Engines as a way to Micro services
Rails Engines as a way to Micro servicesRails Engines as a way to Micro services
Rails Engines as a way to Micro servicesLucas Alencar
 
Ultra-modern Front-end Dev & Introducing Spar
Ultra-modern Front-end Dev & Introducing SparUltra-modern Front-end Dev & Introducing Spar
Ultra-modern Front-end Dev & Introducing SparAaron White
 
WordPress REST API v2: Overview & Exploring
WordPress REST API v2: Overview & ExploringWordPress REST API v2: Overview & Exploring
WordPress REST API v2: Overview & ExploringNick Pelton
 
Apache Sling - The whys and the hows
Apache Sling - The whys and the howsApache Sling - The whys and the hows
Apache Sling - The whys and the howsRobert Munteanu
 
عرض حول وردبريس
عرض حول وردبريسعرض حول وردبريس
عرض حول وردبريسMohammed SAHLI
 
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!Evan Mullins
 
Rails engines in large apps
Rails engines in large appsRails engines in large apps
Rails engines in large appsEnrico Teotti
 
Web components with Angular
Web components with AngularWeb components with Angular
Web components with AngularAna Cidre
 
Etech2005
Etech2005Etech2005
Etech2005royans
 
Code diving in Ruby and Rails
Code diving in Ruby and RailsCode diving in Ruby and Rails
Code diving in Ruby and Railslrdesign
 
Introduction to afp
Introduction to afpIntroduction to afp
Introduction to afpMike Feltman
 
EEA Volto Add-ons - Plone Conference 2020
EEA Volto Add-ons - Plone Conference 2020EEA Volto Add-ons - Plone Conference 2020
EEA Volto Add-ons - Plone Conference 2020Alin Voinea
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumJeroen van Dijk
 

Mais procurados (19)

Rails Engines as a way to Micro services
Rails Engines as a way to Micro servicesRails Engines as a way to Micro services
Rails Engines as a way to Micro services
 
Ultra-modern Front-end Dev & Introducing Spar
Ultra-modern Front-end Dev & Introducing SparUltra-modern Front-end Dev & Introducing Spar
Ultra-modern Front-end Dev & Introducing Spar
 
WordPress REST API v2: Overview & Exploring
WordPress REST API v2: Overview & ExploringWordPress REST API v2: Overview & Exploring
WordPress REST API v2: Overview & Exploring
 
Apache Sling - The whys and the hows
Apache Sling - The whys and the howsApache Sling - The whys and the hows
Apache Sling - The whys and the hows
 
Rails Engines
Rails EnginesRails Engines
Rails Engines
 
عرض حول وردبريس
عرض حول وردبريسعرض حول وردبريس
عرض حول وردبريس
 
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
 
Rails engines in large apps
Rails engines in large appsRails engines in large apps
Rails engines in large apps
 
Web components with Angular
Web components with AngularWeb components with Angular
Web components with Angular
 
Etech2005
Etech2005Etech2005
Etech2005
 
Code diving in Ruby and Rails
Code diving in Ruby and RailsCode diving in Ruby and Rails
Code diving in Ruby and Rails
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
Introduction to afp
Introduction to afpIntroduction to afp
Introduction to afp
 
EEA Volto Add-ons - Plone Conference 2020
EEA Volto Add-ons - Plone Conference 2020EEA Volto Add-ons - Plone Conference 2020
EEA Volto Add-ons - Plone Conference 2020
 
Full slidescr16
Full slidescr16Full slidescr16
Full slidescr16
 
SCA Reaches the Cloud
SCA Reaches the CloudSCA Reaches the Cloud
SCA Reaches the Cloud
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in Titanium
 
- Webexpo 2010
- Webexpo 2010- Webexpo 2010
- Webexpo 2010
 

Destaque

An introduction to Apache Camel
An introduction to Apache CamelAn introduction to Apache Camel
An introduction to Apache CamelKapil Kumar
 
Workshop apache camel
Workshop apache camelWorkshop apache camel
Workshop apache camelMarko Seifert
 
Taking Apache Camel For a Ride
Taking Apache Camel For a RideTaking Apache Camel For a Ride
Taking Apache Camel For a RideBruce Snyder
 
Integration made easy with Apache Camel
Integration made easy with Apache CamelIntegration made easy with Apache Camel
Integration made easy with Apache CamelRosen Spasov
 
Taking Apache Camel For A Ride
Taking Apache Camel For A RideTaking Apache Camel For A Ride
Taking Apache Camel For A RideBruce Snyder
 
«Spring Integration as Integration Patterns Provider»
«Spring Integration as Integration Patterns Provider»«Spring Integration as Integration Patterns Provider»
«Spring Integration as Integration Patterns Provider»IT Weekend
 
Apache Camel Lifecycle
Apache Camel LifecycleApache Camel Lifecycle
Apache Camel LifecycleIlya Lapitan
 
Apache Camel & The Art of Entreprise Integration
Apache Camel & The Art of Entreprise IntegrationApache Camel & The Art of Entreprise Integration
Apache Camel & The Art of Entreprise IntegrationAbdellatif BOUCHAMA
 
Wild Flies and a Camel Java EE Integration Stories
Wild Flies and a Camel Java EE Integration StoriesWild Flies and a Camel Java EE Integration Stories
Wild Flies and a Camel Java EE Integration StoriesMarkus Eisele
 
Self Repairing Tree Topology Enabling Content Based Routing In Local Area Ne...
Self Repairing Tree Topology Enabling  Content Based Routing In Local Area Ne...Self Repairing Tree Topology Enabling  Content Based Routing In Local Area Ne...
Self Repairing Tree Topology Enabling Content Based Routing In Local Area Ne...ncct
 
Messaging with Spring Integration
Messaging with Spring IntegrationMessaging with Spring Integration
Messaging with Spring IntegrationVadim Mikhnevych
 
Apache Camel
Apache CamelApache Camel
Apache CamelGenevaJUG
 
Spring Integration and EIP Introduction
Spring Integration and EIP IntroductionSpring Integration and EIP Introduction
Spring Integration and EIP IntroductionIwein Fuld
 
Elegant Systems Integration w/ Apache Camel
Elegant Systems Integration w/ Apache CamelElegant Systems Integration w/ Apache Camel
Elegant Systems Integration w/ Apache CamelPradeep Elankumaran
 
Consuming External Content and Enriching Content with Apache Camel
Consuming External Content and Enriching Content with Apache CamelConsuming External Content and Enriching Content with Apache Camel
Consuming External Content and Enriching Content with Apache Cameltherealgaston
 
Event Driven Architecture with Apache Camel
Event Driven Architecture with Apache CamelEvent Driven Architecture with Apache Camel
Event Driven Architecture with Apache Camelprajods
 
Apache Camel - The integration library
Apache Camel - The integration libraryApache Camel - The integration library
Apache Camel - The integration libraryClaus Ibsen
 

Destaque (20)

An introduction to Apache Camel
An introduction to Apache CamelAn introduction to Apache Camel
An introduction to Apache Camel
 
Cbr
CbrCbr
Cbr
 
Workshop apache camel
Workshop apache camelWorkshop apache camel
Workshop apache camel
 
Taking Apache Camel For a Ride
Taking Apache Camel For a RideTaking Apache Camel For a Ride
Taking Apache Camel For a Ride
 
Integration made easy with Apache Camel
Integration made easy with Apache CamelIntegration made easy with Apache Camel
Integration made easy with Apache Camel
 
Apache camel
Apache camelApache camel
Apache camel
 
Taking Apache Camel For A Ride
Taking Apache Camel For A RideTaking Apache Camel For A Ride
Taking Apache Camel For A Ride
 
«Spring Integration as Integration Patterns Provider»
«Spring Integration as Integration Patterns Provider»«Spring Integration as Integration Patterns Provider»
«Spring Integration as Integration Patterns Provider»
 
Apache Camel Lifecycle
Apache Camel LifecycleApache Camel Lifecycle
Apache Camel Lifecycle
 
Apache Camel & The Art of Entreprise Integration
Apache Camel & The Art of Entreprise IntegrationApache Camel & The Art of Entreprise Integration
Apache Camel & The Art of Entreprise Integration
 
Wild Flies and a Camel Java EE Integration Stories
Wild Flies and a Camel Java EE Integration StoriesWild Flies and a Camel Java EE Integration Stories
Wild Flies and a Camel Java EE Integration Stories
 
Self Repairing Tree Topology Enabling Content Based Routing In Local Area Ne...
Self Repairing Tree Topology Enabling  Content Based Routing In Local Area Ne...Self Repairing Tree Topology Enabling  Content Based Routing In Local Area Ne...
Self Repairing Tree Topology Enabling Content Based Routing In Local Area Ne...
 
Messaging with Spring Integration
Messaging with Spring IntegrationMessaging with Spring Integration
Messaging with Spring Integration
 
Apache Camel
Apache CamelApache Camel
Apache Camel
 
Spring Integration and EIP Introduction
Spring Integration and EIP IntroductionSpring Integration and EIP Introduction
Spring Integration and EIP Introduction
 
Elegant Systems Integration w/ Apache Camel
Elegant Systems Integration w/ Apache CamelElegant Systems Integration w/ Apache Camel
Elegant Systems Integration w/ Apache Camel
 
Consuming External Content and Enriching Content with Apache Camel
Consuming External Content and Enriching Content with Apache CamelConsuming External Content and Enriching Content with Apache Camel
Consuming External Content and Enriching Content with Apache Camel
 
Event Driven Architecture with Apache Camel
Event Driven Architecture with Apache CamelEvent Driven Architecture with Apache Camel
Event Driven Architecture with Apache Camel
 
Tml for Ruby on Rails
Tml for Ruby on RailsTml for Ruby on Rails
Tml for Ruby on Rails
 
Apache Camel - The integration library
Apache Camel - The integration libraryApache Camel - The integration library
Apache Camel - The integration library
 

Semelhante a Xke - Introduction to Apache Camel

Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsJazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsEdgar Silva
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moondavejohnson
 
Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixAdrian Trenaman
 
ServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIGert Vanthienen
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixBruce Snyder
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsRicardo Varela
 
Apache ServiceMix4 : Dream platform for Java Integration
Apache ServiceMix4 : Dream platform for Java Integration Apache ServiceMix4 : Dream platform for Java Integration
Apache ServiceMix4 : Dream platform for Java Integration Charles Moulliard
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformAlfresco Software
 
Introductiontoapachecamel 110131060022-phpapp01
Introductiontoapachecamel 110131060022-phpapp01Introductiontoapachecamel 110131060022-phpapp01
Introductiontoapachecamel 110131060022-phpapp01dheeraj kumar
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
 
What's New with Windows Phone - FoxCon Talk
What's New with Windows Phone - FoxCon TalkWhat's New with Windows Phone - FoxCon Talk
What's New with Windows Phone - FoxCon TalkSam Basu
 
Are you new to Apache Camel
Are you new to Apache CamelAre you new to Apache Camel
Are you new to Apache Camelgnanagurus
 
Apache Camel - WJax 2008
Apache Camel - WJax 2008Apache Camel - WJax 2008
Apache Camel - WJax 2008inovex GmbH
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran TochAdil Jafri
 
Enterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersEnterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersAndreCharland
 
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
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
Best Practices for Middleware and Integration Architecture Modernization with...
Best Practices for Middleware and Integration Architecture Modernization with...Best Practices for Middleware and Integration Architecture Modernization with...
Best Practices for Middleware and Integration Architecture Modernization with...Claus Ibsen
 

Semelhante a Xke - Introduction to Apache Camel (20)

Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsJazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMix
 
ServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBI
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
Riding Apache Camel
Riding Apache CamelRiding Apache Camel
Riding Apache Camel
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 
Apache ServiceMix4 : Dream platform for Java Integration
Apache ServiceMix4 : Dream platform for Java Integration Apache ServiceMix4 : Dream platform for Java Integration
Apache ServiceMix4 : Dream platform for Java Integration
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
 
Introductiontoapachecamel 110131060022-phpapp01
Introductiontoapachecamel 110131060022-phpapp01Introductiontoapachecamel 110131060022-phpapp01
Introductiontoapachecamel 110131060022-phpapp01
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
What's New with Windows Phone - FoxCon Talk
What's New with Windows Phone - FoxCon TalkWhat's New with Windows Phone - FoxCon Talk
What's New with Windows Phone - FoxCon Talk
 
Are you new to Apache Camel
Are you new to Apache CamelAre you new to Apache Camel
Are you new to Apache Camel
 
Apache Camel - WJax 2008
Apache Camel - WJax 2008Apache Camel - WJax 2008
Apache Camel - WJax 2008
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 
Transforming WebSockets
Transforming WebSocketsTransforming WebSockets
Transforming WebSockets
 
Enterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersEnterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript Developers
 
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...
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Best Practices for Middleware and Integration Architecture Modernization with...
Best Practices for Middleware and Integration Architecture Modernization with...Best Practices for Middleware and Integration Architecture Modernization with...
Best Practices for Middleware and Integration Architecture Modernization with...
 

Último

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Último (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Xke - Introduction to Apache Camel

  • 1. Apache Camel Taking Camel for a ride Hands on Xke Alexis Kinsella June 11, 2010
  • 3.
  • 4.
  • 5.
  • 6. www.xebia.fr / blog.xebia.fr Some informations before you start ...
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 15. Message Routing www.xebia.fr / blog.xebia.fr Endpoint B Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint A Message
  • 16. Camel Components www.xebia.fr / blog.xebia.fr
  • 17.
  • 18. Simple Routing www.xebia.fr / blog.xebia.fr Endpoint B Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint A Message File Jms
  • 19. Pipeline www.xebia.fr / blog.xebia.fr Endpoint B Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint A Message Endpoint C Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint D Message Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget
  • 20. Multicast www.xebia.fr / blog.xebia.fr Endpoint B Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed magna urna, varius a facilisis nec, sagittis eget eros. Mauris scelerisque justo et ipsum scelerisque aliquam. In at auctor diam. Suspendisse ut justo sed diam Endpoint A Message Endpoint B Endpoint B File IBatis SMTP SFTP
  • 21. Message filter: Spring XML www.xebia.fr / blog.xebia.fr <? xml version = &quot;1.0&quot; encoding = &quot;UTF-8&quot; ?> < beans xmlns = &quot;http://www.springframework.org/schema/beans&quot; xmlns:xsi = &quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:schemaLocation = &quot;…&quot; > < camelContext xmlns = &quot;http://activemq.apache.org/camel/schema/spring&quot; > < route > < from uri = &quot;activemq:topic:Quotes&quot; /> < filter > < xpath > /quote/product = ‘widget’ </ xpath > < to uri = &quot;mqseries:WidgetQuotes&quot; /> </ filter > </ route > </ camelContext > </ beans >
  • 22. Message filter: Java DSL www.xebia.fr / blog.xebia.fr package com.acme.quotes; import org.apache.camel.builder.RouteBuilder; public class MyRouteBuilder extends RouteBuilder { public void configure() { // forward widget quotes to MQSeries from( &quot;activemq:topic:Quotes&quot; ). filter().xpath( &quot;/quote/product = ‘widget’&quot; ). to( &quot;mqseries:WidgetQuotes&quot; ); } }
  • 23. Content Based Router: Java www.xebia.fr / blog.xebia.fr from( &quot;activemq:NewOrders&quot; ). choice().when().xpath( &quot;/quote/product = 'widget'&quot; ). to( &quot;activemq:Orders.Widgets&quot; ). choice().when().xpath( &quot;/quote/product = 'gadget'&quot; ). to( &quot;activemq:Orders.Gadgets&quot; ). otherwise(). to( &quot;activemq:Orders.Bad&quot; );
  • 24. Content Based Router: Spring XML www.xebia.fr / blog.xebia.fr <? xml version = &quot;1.0&quot; encoding = &quot;UTF-8&quot; ?> < beans xmlns = &quot;http://www.springframework.org/schema/beans&quot; xmlns:xsi = &quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:schemaLocation = &quot;...&quot; > < camelContext xmlns = &quot;http://activemq.apache.org/camel/schema/spring&quot; > < route > < from uri = &quot;activemq:NewOrders&quot; /> < choice > < when > < xpath > /order/product = 'widget' </ xpath > < to uri = &quot;activemq:Orders.Widgets&quot; /> </ when > < when > < xpath > /order/product = 'gadget' </ xpath > < to uri = &quot;activemq:Orders.Gadgets&quot; /> </ when > < otherwise > < to uri = &quot;activemq:Orders.Bad&quot; /> </ otherwise > </ choice > </ route > </ camelContext > </ beans >
  • 25.
  • 26.
  • 27.
  • 28.
  • 29. Predicates examples www.xebia.fr / blog.xebia.fr from( &quot;jms:queue:order&quot; ) .choice() .when(header( &quot;type&quot; ).isEqualTo( &quot;widget&quot; )).to( &quot;bean:widgetOrder&quot; ) .when(header( &quot;type&quot; ).isEqualTo( &quot;wombat&quot; )).to( &quot;bean:wombatOrder&quot; ) .otherwise() .to( &quot;bean:miscOrder&quot; ) .end(); Predicate isWidget = header( &quot;type&quot; ).isEqualTo( &quot;widget&quot; ); from( &quot;jms:queue:order&quot; ) .choice() .when( isWidget ).to( &quot;bean:widgetOrder&quot; ) .when( isWombat ).to( &quot;bean:wombatOrder&quot; ) .otherwise() .to( &quot;bean:miscOrder&quot; ) .end();
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38. @Bean annotation www.xebia.fr / blog.xebia.fr public class Foo { @ MessageDriven ( uri = &quot;activemq:my.queue&quot; ) public void doSomething( @Bean ( &quot;myCorrelationIdGenerator&quot; ) String correlationID, @Body String body) { // process the inbound message here } } public class MyIdGenerator { private UserManager userManager ; public String generate( @ Header ( name = &quot;user&quot; ) String user, @Body String payload) throws Exception { User user = userManager .lookupUser(user); String id = user.getPrimaryId() + generateHashCodeForPayload (payload); return id; } }
  • 39.
  • 40.
  • 41. Testing with camel www.xebia.fr / blog.xebia.fr public class FilterTest extends CamelTestSupport { @EndpointInject (uri = &quot;mock:result&quot; ) protected MockEndpoint resultEndpoint ; @Produce (uri = &quot;direct:start&quot; ) protected ProducerTemplate template ; public void testSendMatchingMessage() throws Exception { String expectedBody = &quot;<matched/>&quot; ; resultEndpoint .expectedBodiesReceived(expectedBody); template .sendBodyAndHeader(expectedBody, &quot;foo&quot; , &quot;bar&quot; ); resultEndpoint .assertIsSatisfied(); } public void testSendNotMatchingMessage() throws Exception { resultEndpoint .expectedMessageCount(0); template .sendBodyAndHeader( &quot;<notMatched/>&quot; , &quot;foo&quot; , &quot;notMatchedHeaderValue&quot; ); resultEndpoint .assertIsSatisfied(); } @Override protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from( &quot;direct:start&quot; ).filter(header( &quot;foo&quot; ).isEqualTo( &quot;bar&quot; )).to( &quot;mock:result&quot; ); } }; } }
  • 42. Spring Test with Java Config www.xebia.fr / blog.xebia.fr @ ContextConfiguration ( locations = &quot;org.apache.camel.spring.javaconfig.patterns.FilterTest$ContextConfig&quot; , loader = JavaConfigContextLoader . class ) public class FilterTest extends AbstractJUnit4SpringContextTests { @EndpointInject (uri = &quot;mock:result&quot; ) protected MockEndpoint resultEndpoint ; @Produce (uri = &quot;direct:start&quot; ) protected ProducerTemplate template ; @ DirtiesContext @Test public void testSendMatchingMessage() throws Exception { String expectedBody = &quot;<matched/>&quot; ; resultEndpoint .expectedBodiesReceived(expectedBody); template .sendBodyAndHeader(expectedBody, &quot;foo&quot; , &quot;bar&quot; ); resultEndpoint .assertIsSatisfied(); } @ Configuration public static class ContextConfig extends SingleRouteCamelConfiguration { @Bean public RouteBuilder route() { return new RouteBuilder() { public void configure() { from( &quot;direct:start&quot; ).filter(header( &quot;foo&quot; ).isEqualTo( &quot;bar&quot; )).to( &quot;mock:result&quot; ); } }; } } }
  • 43.
  • 44.
  • 45.
  • 46.
  • 47. www.xebia.fr / blog.xebia.fr Going further with Apache Camel …
  • 48.
  • 49.
  • 50. www.xebia.fr / blog.xebia.fr Twitter: @alexiskinsella Thank You

Notas do Editor

  1. 06/10/10
  2. 06/10/10
  3. 06/10/10
  4. 06/10/10
  5. 06/10/10
  6. 06/10/10
  7. 06/10/10
  8. 06/10/10
  9. 06/10/10
  10. 06/10/10
  11. 06/10/10
  12. 06/10/10
  13. 06/10/10
  14. 06/10/10
  15. 06/10/10
  16. 06/10/10
  17. 06/10/10
  18. 06/10/10
  19. 06/10/10
  20. 06/10/10
  21. 06/10/10
  22. 06/10/10
  23. 06/10/10
  24. 06/10/10
  25. 06/10/10
  26. 06/10/10
  27. 06/10/10
  28. 06/10/10
  29. 06/10/10
  30. 06/10/10
  31. 06/10/10
  32. 06/10/10
  33. 06/10/10
  34. 06/10/10
  35. 06/10/10
  36. 06/10/10
  37. 06/10/10
  38. 06/10/10
  39. 06/10/10
  40. 06/10/10
  41. 06/10/10
  42. 06/10/10
  43. 06/10/10
  44. 06/10/10
  45. 06/10/10
  46. 06/10/10
  47. 06/10/10
  48. 06/10/10
  49. 06/10/10
  50. 06/10/10