Workshop apache camel

490 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
490
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Workshop apache camel

  1. 1. Technologie WorkshopsApache Camel
  2. 2. Einleitung: Enterprise Application Integration CORBA System ABC System XYZ System 567 Systemlandschaften aus: RMI SOAP •System XYZ unterschiedlichen System 123 System • mit unterschiedlichen Schnittstellen JDBC • in unterschiedlichen TechnologienPOP3, SMTP JMS JMS Message Datei- DB Mail Gateway Broker system
  3. 3. Messaging Entkopplung der Systeme Schnittstellen (lose Kopplung) Last Asynchrone Kommunikation Maximaler Durchsatz Lastentkopplung, bessere Drosselung bedingt offline-fähig Ausfallsicherheit (Store and Forward) Transaktional
  4. 4. Enterprise Integration Patterns (EIP) Pattern-Katalog, Messaging Muster für die Integration von Systemen http://www.eaipatterns.com/ http://camel.apache.org/enterprise-integration-patterns.html
  5. 5. Apche Camel„Die smarteste Versuchung fürSystemintegration“ JavaMagazin 4/2012, Kai Wähner Referenzimplementierung der EIP
  6. 6. APIRouteBuilder#configure(){ from(EP1).to(EP2); from(EP1).bean(myBean, "doSomething"); from(EP1).process(myProcessor); from(EP1).transform(myBean, "doSomething"); from(EP1).recipientList(simple("direct:${header.operationName}")); from(EP1).multicast().to(EP2, EP3,EP4); …}
  7. 7. Spring DSL<camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="EP-URI1"/> <to uri="EP-URI2"/> </route></camelContext><camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="EP-URI1"/> <to uri="myBean"/> </route></camelContext><bean id="myBean" class="…"/>
  8. 8. Spring DSL Transform<route> <from uri="EP-URI1"/> <bean ref="myBeanName" method="doTransform"/> <to uri="EP-URI2"/></route><camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="EP-URI1"/> <transform> <simple>${in.body} extra data!</simple> </transform> <to uri="EP-URI2"/> </route></camelContext>
  9. 9. Spring DSL Dynamic Recipient List<camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="EP-URI1"/> <multicast> <to uri="EP-URI2"/> <to uri="EP-URI3"/> <to uri="EP-URI4"/> </multicast> </route></camelContext>
  10. 10. Spring DSL Static Recipient List<camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="EP-URI1"/> <recipientList> <xpath>$foo</xpath> </recipientList> </route> <route> <from uri="EP-URI2" /> <recipientList delimiter=","> <header>myHeader</header> </recipientList> </route></camelContext>
  11. 11. Aufgabe Ticketsystem Nachrichten per Webservice in das System WS-Antwort mit Ticket-ID Backup im Filesystem Versand per E-Mail
  12. 12. Aufbau class Architektur Apache Camel camel-cxf camel-mail RouteBuilder + configure()() : void «interface» IncidentMessage IncidentRoute IncidentServ ice - message: String + configure()() : void + addIncident(IncidentMessage) : Integer - priority: Integer WS Endpoint erzeugen String uri = "cxf:/incindent?serviceClass="+IncidentService.class.getName(); from(uri)....
  13. 13. Marko SeifertPublic Space SolutionsT-Systems Multimedia Solutions GmbHRiesaer Straße 501129 Dresden

×