Camel overview

712 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
712
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
25
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Camel overview

  1. 1. Camel Overview
  2. 2. Apa itu Apache Camel?
  3. 3. Apache camel (Fuse Mediation Router) merupakansebuah integrasi frameworkopensourceberdasarkan Enterprise Integration Patterns.Apache camel jugamenyediakan bahasa (DSL) untuk mendefinisikan routing.Misalnya,ada file baru diupload,kemudian parsing,insert ke database lalu kirim notifikasi.Camel menggunakanURI untuk bekerja secara langsung dengan segala jenis Transportasi atau modelmessaging seperti HTTP,ActiveMQ,JMS,JBI,SCA,MINA atau CXF,serta komponenpluggable dan pilihan formatdata,camel juga merupakan sebuah perpustakaan kecildengan defendensi minimal untuk embeding dalam aplikasi java.camel memungkinkananda bekerja dengan API yang sama terlepas dari jeis transport yangdigunakan,jadi belajar API sekali dan anda bisa berinteraksi dengan semuakomponen yang di sediaka di out-of-box.Proyek-proyek berikut dapatmemanfaatkan Apache Camel sebagai routing dan mesin mediasi.- Apache Servicemix -ESB dan JBI kontainer-Apache ActiveMQ -banyak digunakan sumber broker-Apache Karaf – runtime OSGI kecil berbasis dimana aplkasi dapat digunakan-Apache Mina – Kinerja tinggi NIO berbasis Framework jaringan
  4. 4. Enterprise Integration Patterns Dalam Camel Terdiri Dari :Messaging SystemMessaging ChannelsMessage ContructionMessage RoutingMessage TransformationMessage Endpoints danSystem Management
  5. 5. Enterprise Integration Pattern
  6. 6. Integrasi Camel dan EIP from(“a”).to(“b”)
  7. 7. from(“a”).choice().when(). method(“controlBean”,“isOK”). to(“x”).end().pipeline(“b”, “c”, “d”); Meruvian Hunabku Team
  8. 8. Komponen Camel
  9. 9. Endpoint URI <component-name>:<component-spec>[?params]from(“file:/tmp?consumer.delay=1000”)from(“bean:myBean?methodName=getOrders”)from(“quickfix-server:server.cfg?log=#loggingFactoryBean”)
  10. 10. Filter Route – Java DSL import org.apache.camel.builder.RouteBuilder; public class FilterRoute extends RouteBuilder {public void configure() throws Exception {from("activemq:queue:quote") .filter().xpath("/quote/product =‘widget’") .to("mq:quote"); }} 
  11. 11. Filter Route – Java DSLpublic void configure() throws Exception { Endpoint A = endpoint("activemq:queue:quote"); Endpoint B = endpoint("mq:quote"); Predicate isWidget = xpath("/quote/product = ‘widget’"); from(A).filter(isWidget).to(B); }import org.apache.camel.builder.RouteBuilder;import static org.apache.camel.builder.xml.XPathBuilder.xpath;public class FilterRoute extends RouteBuilder {public void configure() throws Exception { Endpoint A = endpoint("activemq:queue:quote"); Endpoint B = endpoint("mq:quote"); Predicate isWidget = xpath("/quote/product = ‘widget’");from(A).filter(isWidget).to(B); } }
  12. 12. Content Based Router
  13. 13. Content Based Router
  14. 14. Message Filter
  15. 15. Splitter
  16. 16. Bean sebagai Message Translator
  17. 17. Aggregator
  18. 18. Resequencer
  19. 19. Routing Slip
  20. 20. Error Handling
  21. 21. try … catch … finally
  22. 22. Message-Driven POJO
  23. 23. Camel dan ActiveMQ${ACTIVEMQ_HOME}/conf/activemq.xml<camelContext id=“camel” xmlns=“http://camel.apache.org/schema/spring”> <route> <!-- you can add routes here --> </route></camelContext>
  24. 24. ELVISDOTCOM333

×