SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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...
 

Kürzlich hochgeladen

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Kürzlich hochgeladen (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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

Hinweis der Redaktion

  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