Your SlideShare is downloading. ×
Fusesource camel-persistence-part2-webinar-charles-moulliard
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Fusesource camel-persistence-part2-webinar-charles-moulliard

1,423
views

Published on

Second part of my webinar about Transaction Management with Camel on Fuse ESB / Apache ServiceMix. Include also persistence with Idempotent consumer and aggregator EIP patterns

Second part of my webinar about Transaction Management with Camel on Fuse ESB / Apache ServiceMix. Include also persistence with Idempotent consumer and aggregator EIP patterns

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,423
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
88
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Transac6on  Management  with  Apache  Camel,  ServiceMix  -­‐  EIPs  Part  II  Charles Moulliard – Raul Kripalani,November 22nd, 2011 A  Progress  So3ware  Company  1   Copyright  ©  2010  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 2. When you joined today’s session … Audio is broadcast from your computer Submit your questions via the Chat Window Contact today’s Host via the Chat Window2   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 3. Learn  More  at  hLp://fusesource.com  3   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 4. Speaker  –  Charles  Moulliard     Engineer  in  Agronomy  &  Master   Follow  me  on  :   in  Zoology     17  years  of  experience  in  IT    hLp://twiLer.com/cmoulliard   world  development  (J2EE,  .NET)    hLp://www.linkedin.com/in/ •  Specialised  in  new  technologies   charlesmoulliard   web/Internet  &  integra6on   •  Project  manager  in  bank,  financial,                    hLp://cmoulliard.blogspot.com   telco,  insurance  and  transport   world                      hLp://www.slideshare.net/   Solu6on  Architect  at  FuseSource       cmoulliard     CommiLer  on  Apache  projects  :     •  Apache  ServiceMix,    Apache  Karaf   (PMC)  ,  Apache  Camel,  Fuse  Fabric,   Scalate  4   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 5. Agenda    Goal  :  Transac6on  Management  with  Apache   Camel,  ServiceMix  -­‐  EIPs   • Transac6ons  with  Camel   • JMS  and  JDBC  alone   • Fuse  ESB  Tx  Manager   • Using  Global  Transac6on  Manager  (XA)   • Persistence  with  EIPs   • Idempotent  processor   • Aggregator   • Summary  5   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 6. Table  of  contents    Transac6ons  with  Camel    JMS  and  JDBC  alone    Fuse  ESB  Tx  Manager    Using  Global  Transac6on  Manager  (XA)    Persistence  with  EIPs   • Idempotent  processor   • Aggregator    Summary  6   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 7. Transac6ons  with  Camel    Camel  does  not  re-­‐invent  the  wheel  and  use  Spring  or   Blueprint  API  (on  Apache  ServiceMix)    Can  work  with  local  or  provided  Tx  Manager   •  Local  =  Spring  (JMS,  JPA,  JDBC,  Hibernate),  Atomikos,   Bitronix,  jOTM   •  Provided  =  J2EE  (WebSphere,  JBoss,  Glassfish,  BEA,   Geronimo),  Apache  ServiceMix    7   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 8. Transac6ons  with  Camel    Factors  affec6ng  Architecture  depends  on  :   •  Component  (Transac6onal  or  not),     •  Type  of  Transac6on  Manager  and  DataSource  (XA  or  not),     •  Route  (simple,  complex),   •  Transacrion  Propaga6on  Type  (REQUIRED,  NEW,   MANDATORY,  ….)    How  to  configure  a  Camel  route  to  be  transac6onal    2  approaches  exist  and  they  can  be  combined  8   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 9. Transac6ons  with  Camel  (1)  A)  Using  a  Transac6onal  component  for  producer  or   consumer  How  To  :    Check  which  component  are  Tx   aware    jpa,  sql,  jms,  file,   hibernate,  iba6s.    Configure  a  Transac6on  Manager   for  the  endpoint  9   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 10. Transac6ons  with  Camel  (2)    Simple  Transac6onal  JMS  client  configura6on  example   Spring JMS Tx manager is defined Here we provide the parameters10   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 11. Transac6ons  with  Camel  (3)  B)  Configure  a  Camel  route  as  Transac6onal    Advantage  :  allow  to  include  processors  (beans,  jpa,   hibernate)  with  a  Transac6onal  route    How  to  configure  it    add  <transacted>  to  the  route    How  does  it  work   •  Camel  will  automa6c  lookup  to  find  a  Spring  transac6on   manager   (org.springframework.transac6on.PlasormTransac6onManager)   •  Transac6on  Manager  creates  a  Transac6on  (according  to   PROPAGATION  Policy)   •  Transac6onError  handler  will  take  care  of  excep6ons  occuring   during  camel  exchange  and  propagated  it  to  the  caller  11   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 12. Transac6ons  with  Camel  (4)    Example  of  Camel  Transac6on  route   A B Camel will lookup for “PROPAGATION_REQUIRED”12   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 13. Transac6ons  with  Camel  (5)    Reference  of  the  SpringTransac6onPolicy  can  be  provided   Reference to the bean13   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 14. Transac6ons  with  Camel  (6)    Another  example  using  <Policy>  DSL  and   SpringTransac6onPolicy  is  provided  to  the  TxErrorHandler   Transacted is replaced by Policy14   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 15. Transac6ons  with  Camel  (7)    Transac6on  policy  can  be  defined  using  class   org.apache.camel.spi.TransactedPolicy    Policies  can  be  mixed  in  Camel  routes  to  use  different   transac6on  propaga6ons  (NEW,  REQUIRED,  …)  15   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 16. Transac6ons  with  Camel  (8)    Example  of  2  Camel  routes  using  different  Policy         Required policy : will use an existing Transaction or request to create a new Requires-New policy will request a new Transaction16   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 17. Transac6ons  with  Camel  (9)    Transac6on  rollback  occurs  when  a  run6me  excep6on  is   raised  but  you  can  also  manage  it  using  <rollback>  DSL   We force a Rollback by generating a org.apache.camel.Rollbac kExchangeException17   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 18. Transac6ons  with  Camel  (9)    Using  markRollBackOnly  generates  a  Rollback  without   excep6on  in  the  Camel  route   Rollback occurs in BookService (DB), exception is not send to direct (which is not Tx aware) and exception is send to mock endpoint18   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 19. Transac6ons  with  Camel  (10)    When  Apache  Camel  producer/consumer  is  not   Transac6onal,  a  compensa6on  mechanism  can  be   used.    Uses  a  synchronisa6on  mechanism  =  callback  (mimic   Tx)  to  group  tasks  as  a  UnitOfWork    Will  react  with  onComplete  (=commit)  or  onFailure   (=rollback)  19   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 20. Transac6ons  with  Camel  (11)   onCompletion + link to the bean implementing the rollback logic20   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 21. Transac6ons  with  Camel  (12)   Rollback strategy21   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 22. Transac6ons  with  Camel  (13)    Be  carefull  about  threads,  threadPool     •  Only  one  should  be  used,   •  Dont  use  seda://,  vm://,  NMR://  which  are  async  to  link   Camel  routes    Tx  async  are  not  supported  in  Camel  2.x  (planned  for   Camel  3.x)    More  info  :  hLp://fusesource.com/docs/router/2.8/ transac6ons/TxnDemarca6on-­‐ErrorHandling.html  22   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 23. Table  of  contents    Transac6ons  with  Camel    JMS  and  JDBC  alone    Fuse  ESB  Tx  Manager    Using  a  Global  Transac6on  Manager  (XA)    Persistence  with  EIPs   • Idempotent  processor   • Aggregator    Summary  23   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 24. JMS  and  JDBC    Integra6on  project,  most  probably,  will  use  not  only  1   Tx  Manager  but  a  combina6on  using  JMS  +  JDBC,  JDBC   +  JDBC,  JMS  +  JMS,  …    Such  a  project  can  use  Spring  or  Fuse  ESB  Tx  Managers    2  Approaches  are  available  on  Fuse  ESB   •  Spring  /  Spring  DM  (Dynamic  Modules)   •  Aries  Blueprint    Apache  Aries  project  =  implementa6on  of  Enterprise   features  of  OSGI  EE  specifica6ons  (Transac6on,  JPA,   JNDI,  Web)    24   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 25. JMS  and  JDBC    Use  Case  descrip6on    25   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 26. JMS  and  JDBC  (1)  -­‐  Spring    Example  of  a  project  containing  a  JPA,  Datasource  and   a  camel  route  with  Ac6veMQ  JMS  queues   DataSource is created using Apache Commons DBCP And is exported as OSGI Service wit h2 filters26   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 27. JMS  and  JDBC  (2)  -­‐  Spring    JPA  Persistence  file  –  transac6on-­‐type  =  "RESOURCE-­‐ LOCAL"  27   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 28. JMS  and  JDBC  (3)  -­‐  Spring   Spring will inject persistence context Method will be added into an existing Transaction28   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 29. JMS  and  JDBC  (4)  -­‐  Spring   DAO will be scanned by spring to find @Annotation DAO is exposed as a service Spring will add Tx demarcation Based on @Transactional annotations Our Spring JPA Tx Manager is exported and will be used by Camel route A  Progress  So3ware  Company  29   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.    
  • 30. JMS  and  JDBC  (5)  -­‐  Spring   Spring JMS Tx Manager Message rollbacked will be moved directly into the DLQ Transacted = true, ref to Tx manager, CACHE_NONE to avoid that Spring uses another session (thread))30   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 31. JMS  and  JDBC  (6)  -­‐  Spring   We search for JPA Tx Manager  Camel  Spring  configura6on   We configure 2 Transaction Policy (one for JMS, other for JPA)31   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 32. JMS  and  JDBC  (5)  -­‐  Spring    Apache  Camel  routes   JMS + JDBC JMS + JMS32   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 33. Table  of  contents    Transac6ons  with  Camel    JMS  and  JDBC  alone    Fuse  ESB  Tx  Manager    Using  Global  Transac6on  Manager  (XA)    Persistence  with  EIPs   • Idempotent  processor   • Aggregator    Summary  33   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 34. Fuse  ESB  –  Transac6on  Manager    Apache  ServiceMix  4.x  plasorm  (Fuse  ESB)  provides  a   Tx  Manager    Based  on  Apache  Geronimo  Tx  Manager  (JTA  1.1)    Deployed  using  feature    transac6on    Contains  the  following  bundle    34   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 35. Fuse  ESB  –  Transac6on  Manager  (1)    Can  be  used  as  a  Global  JTA  Tx  Manager  with  XA   Resource    Expose  through  OSGI  service  registry  interfaces     Proxified objects available35   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 36. Fuse  ESB  –  Transac6on  Manager  (2)    Timeout  and  Tx  log  file  can  be  customised    36   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 37. Table  of  contents    Transac6ons  with  Camel    JMS  and  JDBC  alone    Fuse  ESB  Tx  Manager    Using  Global  Transac6on  Manager  (XA)    Persistence  with  EIPs   • Idempotent  processor   • Aggregator    Summary  37   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 38. Global  Tx  Manager  -­‐  XA    Using  a  Global  Transac6on  Manager  on  Fuse  ESB  just   requires  that  we  use  JTA  and  configure  XA  resources    Verify  careful  regarding  to  the  choice  of  the  "drivers"  or   "datasource"  that  you  will  use  (XA  aware)    You  do  not  need  to  use  Spring  JDBC,  JPA,  JMS,   Hibernate  Transac6on  Manager    Aries  Tx  Manager    38   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 39. Global  Tx  Manager  -­‐  XA    Use  Case  39   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 40. Global  Tx  Manager  -­‐  XA  (1)    What  will  change  :  Datasource  (JDBC)   Add a XA Datasource Export XA and non XA Datasource as OSGI services (will be used by JPA container)40   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 41. Global  Tx  Manager  -­‐  XA  (2)    JPA  -­‐  persistence.xml     Use JTA instead of RESOURCE-LOCAL Configure JTA and non-JTA datasource41   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 42. Global  Tx  Manager  -­‐  XA  (3)    JPA  -­‐  spring   We call OSGI Service to retrieve the PlatformTransactionManager object managed by Aries TX Manager42   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 43. Global  Tx  Manager  -­‐  XA  (4)    JMS  –  XA  Connec6on  Pool  /  Resource  Manager     ActiveMQ requires JTA Manager and XAPooledConnectionFactory43   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 44. Global  Tx  Manager  -­‐  XA  (4)    JMS  –  Ac6veMQ  component   Transacted is false in this configuration as Aries Tx xManager will take care !44   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 45. Global  Tx  Manager  -­‐  XA  (1)    Apache  Camel  Route   We use the Global Tx Manager exposed as OSGI Service through Spring TransactionManager to get it for JPA Service45   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 46. Global  Tx  Manager  -­‐  XA  (1)   Nothing has changed except that  Apache  Camel  Route   you could use XA and non XA connection pool for JMS46   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 47. Demo  Transac6ons  in  Ac6on  on  Fuse  ESB  !  47   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 48. Table  of  contents    Transac6ons  with  Camel    JMS  and  JDBC  alone    Fuse  ESB  Tx  Manager    Using  a  Global  Transac6on  Manager  (XA)    Persistence  with  EIPs   • Idempotent  processor   • Aggregator    Summary  48   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 49. Idempotent  processor    Filter  out  duplicate  messages    Uses  an  Expression  to  calculate  a  unique  message  ID,   which  is  looked  up  in  the  repository    By  default,  memory  based    Supports  several  persistent  mode   •  FileIdempotentRepository   •  HazelcastIdempotentRepository  (Available  as  of  Camel  2.8)   •  JdbcMessageIdRepository  (Available  as  of  Camel  2.7)   •  JpaMessageIdRepository  49   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 50. Idempotent  processor  (1)    To  use  JPA  Repository,  simply  configure  a  persistence   file    We  use  as  Model  MessageProcessed  50   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 51. Idempotent  processor  (2)    Model  contains   info  about   propre6es  that   we  will  store   into  the  DB  MessageID = key used tofilter out messages 51   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 52. Idempotent  processor  (3)    Spring  Tx  and  JPA  Template  must  be  configured   Spring Template52   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 53. Idempotent  processor  (3)    Setup  JpaMessageIdRepository   Reference to the JPA template Ref for the Spring bean jpaStore53   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 54. Demo  Idempotent  Consumer  with  JPA  repo  54   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 55. Table  of  contents    Transac6ons  with  Camel    JMS  and  JDBC  alone    Fuse  ESB  Tx  Manager    Using  a  Global  Transac6on  Manager  (XA)    Persistence  with  EIPs   • Idempotent  processor   • Aggregator    Summary  55   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 56. Aggregator    Allows  to  combine  messages  together  into  a  single   message    Support  :   •  JdbcAggregatorRepository  (Available  as  of  Camel  2.7)   •  HawtDBAggregatorRepository  (in-­‐memory  DB)    We  keep  in  DB  the  aggregated  object  as  blob    Allows  to  restart  aggrega6on  process  from  where  it   stops  !56   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 57. Aggregator  (1)    How  agregator  works  57   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 58. Aggregator  (2)    Configura6on  of  the  Persistent  Repository   Configure Repo with DataSource and Tx Manager  And  DB  58   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 59. Aggregator  (3)    MyAggrega6onstrategy  simply  concatenates  the  Body  using  old   and  new  exchange  59   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 60. Aggregator  (4)    Class  contains   Users  and  set   the  Key  id  =   FUSE  that  the   aggregator  will   use  on  the   Exchange   Id = key used60   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 61. Aggregator  (5)    Apache  Camel  route  refers  to  the  Persistent  Repository   Persistent repository61   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 62. Demo  Aggrega6on  with  JDBC  repository  62   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 63. Table  of  contents    Transac6ons  with  Camel    Fuse  ESB  Tx  Manager    JMS  and  JDBC  alone    Using  a  Global  Transac6on  Manager  (XA)    Persistence  with  EIPs   • Idempotent  processor   • Aggregator    Summary  63   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 64. Summary    Transac6ons  in  more  detail   •  Transac6onal  client  <-­‐>  Transacted  /  Policy  mode   •  Propaga6onPolicy   •  Rollback  strategies   •  UnitOfWork  to  synchronise    Present  a  configura6on  with  JDBC,  JMS  Tx  managers    Introduce  Fuse  ESB  Tx  Manager    Global  Transac6on  Manager    EIPs  persistent   •  Idempotent  processor/Consumer   •  Aggregator  64   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 65. For  More  Informa6on     fusesource.com   •  Free  downloads   •  Documenta6on   •  Geyng  Star6ng    demo,  tools  and  advice   •  Webinars  on    beginner  and  advanced  topics   •  White  papers   •  Customer  case  studies     Get  Help   •  Forums   •  Virtual  training   •  Consul6ng   •  Enterprise  subscrip6ons  65   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company  
  • 66. Useful  references    Transac6ons  with  camel  /  Fuse  ESB   • hLp://fusesource.com/docs/router/2.8/ transac6ons/index.html    EIPs  paLerns   • hLp://fusesource.com/docs/router/2.8/eip/ MsgEnd-­‐Idempotent.html     • hLp://fusesource.com/docs/router/2.8/eip/ MsgRout-­‐Aggregator.html    Use  Case  –  Devoxx  Hands  on  Lab   • hLps://github.com/cmoulliard/Devoxx-­‐2011-­‐ HandsOnLab  66   Copyright  ©  2011  Progress  So3ware  Corpora6on  and/or  its  subsidiaries  or  affiliates.  All  rights  reserved.     A  Progress  So3ware  Company