Slides for our talk at #OOP2014
We take care of it - personally!© 2014 innoQ Deutschland GmbHEAI War StoriesPraxisbeispiele zu EAI-Pattern und Lessons Learned!Alexander Heusingfeld, @goldstift Martin Huber, @waterback
View Slide
© 2014 innoQ Deutschland GmbHEAI Pattern in 2013?Nobody uses them anymore!
© 2014 innoQ Deutschland GmbHThat’s THE problem!
© 2014 innoQ Deutschland GmbHMultitude of potential service consumersIntegration is ubiquitousCRMApplication
© 2014 innoQ Deutschland GmbHMultitude of potential service consumersIntegration is ubiquitousCRMApplicationERPApplication
© 2014 innoQ Deutschland GmbHMultitude of potential service consumersIntegration is ubiquitousCRMApplication?
We take care of it - personally!© 2014 innoQ Deutschland GmbHIntegration Styles
© 2014 innoQ Deutschland GmbHFile Transferhttp://www.eaipatterns.com/FileTransferIntegration.
© 2014 innoQ Deutschland GmbHShared Databasehttp://www.eaipatterns.com/SharedDataBaseIntegration.
© 2014 innoQ Deutschland GmbHRemote Procedure Invocationhttp://www.eaipatterns.com/EncapsulatedSynchronousIntegration.
© 2014 innoQ Deutschland GmbHMessaginghttp://www.eaipatterns.com/Messaging.h
© 2013 innoQ Deutschland GmbHMessaging?http://bit.ly/PtrhWy
© 2014 innoQ Deutschland GmbHSearching for a book?Enterprise Integration Patterns(Hohpe & Woolf), 2003www.eaipatterns.comSwiss-army knife for asynchronous messaging
We take care of it - personally!© 2014 innoQ Deutschland GmbHTheories in practice
© 2014 innoQ Deutschland GmbHSimple order management system (CRUD)Real Life Scenarioordermanagementsystem
© 2014 innoQ Deutschland GmbHSimple ChangeRequestordermanagementsystem
© 2014 innoQ Deutschland GmbHSimple ChangeRequestWe need an importer!ordermanagementsystem
© 2013 innoQ Deutschland GmbHA Java EE servlet to the rescue@WebServlet(urlPatterns = {"/order/import"})!public class ImporterServlet extends HttpServlet {!!@Inject OrderBean bean;!@Inject CsvDataParser parser;!!@Override!protected void doPost(HttpServletRequest request,!HttpServletResponse response)!throws ServletException, IOException {!String data = request.getParameter("csvdata");!List orders = parser.transform(data);!for (Order order : orders) {!bean.persist(order);!}!}!}
© 2014 innoQ Deutschland GmbHSystemSimple Change doneordermanagementsystemHTTPcsvTransforBusiness Partner
© 2014 innoQ Deutschland GmbHIntegrate the system of a forwarderSystemChange happensordermanagementsystemHTTPcsvTransforBusiness PartnerforwardersystemFTPSMTPSOAP WSSEREST
© 2014 innoQ Deutschland GmbHWhat are the lessons learned?
© 2014 innoQ Deutschland GmbHRecognize an integration taskwhen it‘s staring in your face?
© 2013 innoQ Deutschland GmbHEASY!http://www.flickr.com/photos/wespionage/184793114
© 2014 innoQ Deutschland GmbHBuild an easy and maintainable solutionfor multiple integration challenges?
© 2013 innoQ Deutschland GmbHNO PROBLEM!http://www.flickr.com/p
© 2014 innoQ Deutschland GmbHAny help in the toolbox?
© 2013 innoQ Deutschland GmbHADAPTERS?http://www.flickr.com/photoProperty of ChinBuye Limited. http://bit.ly/xBKwGw
© 2013 innoQ Deutschland GmbHEAI FrameworksApache Camel Spring Integration
© 2013 innoQ Deutschland GmbHPipes and Filtersdivide your task into small steps
© 2011 innoQ Deutschland GmbHCamel-XML with Spring...!!
© 2011 innoQ Deutschland GmbHCamel fluent API in Javapublic class PipelineExample extends RouteBuilder {!@Overridepublic void configure() throws Exception {from("file://Users/martinh/temp/sample1").to("bean:orderTransform?method=transformOrder").to("bean:orderCheckBean?method=validateOrder").to("jms:queue:order.process");}}
© 2011 innoQ Deutschland GmbHPipes & Filterspublic class PipesFiltersExample extends RouteBuilder {!@Overridepublic void configure() throws Exception {from("jms:queue:order.in?maxConcurrentConsumers=5").to("bean:decryptBean").to("seda:authenticate");!from("seda:authenticate").process(new AuthenticationProcessor()).to("seda:dedup");!from("seda:dedup").process(new DeDupProcessor().to("jms:queue:order.processfurther");!}}
© 2011 innoQ Deutschland GmbHfrom("seda:authenticate")!.process(new AuthenticationProcessor())!.to("seda:dedup");!public class AuthenticationProcessor implements Processor {!! @Override!! public void process(Exchange exchange) throws Exception {!MyOrder order = (MyOrder)exchange.getIn().getBody();!String type = exchange.getIn().getHeader("orderType");!! }!}Pipes & Filters
© 2014 innoQ Deutschland GmbHAll you need are the right tools for the job?
© 2013 innoQ Deutschland GmbHALMOSThttp://www.flickr.com/p
© 2014 innoQ Deutschland GmbHOracleDB + AQAdmin UIReal-life scenario: Control Busxml-route-EAI-NodeEAI-NodeEAI-Nodectrl-queueTomcatEmbedded Jetty
© 2014 innoQ Deutschland GmbHOracleDB + AQReal-life scenario: Control Busxml-route-EAI-Nodedatabase connectionEAI-NodeEAI-Nodectrl-queueInitial Node configurationnode type (command line arg)Admin UI
© 2014 innoQ Deutschland GmbHOracleDB + AQReal-life scenario: Control Busxml-route-EAI-Nodesubscribe to control queueEAI-NodeEAI-Nodectrl-queue1. Server startupAdmin UI
© 2014 innoQ Deutschland GmbHOracleDB + AQReal-life scenario: Control Busxml-route-EAI-Nodeload node-type specific configEAI-NodeEAI-Nodectrl-queuesubscribe to control queue1. Server startupAdmin UI
© 2014 innoQ Deutschland GmbHOracleDB + AQConfig change @Runtimexml-route-EAI-NodeEAI-NodeEAI-Nodectrl-queue2. during runtimeroute config is changedAdmin UI
© 2014 innoQ Deutschland GmbHOracleDB + AQConfig change @Runtimexml-route-EAI-NodeEAI-NodeEAI-Nodectrl-queueroute config is changedpublish config update messageAdmin UI2. during runtime
© 2014 innoQ Deutschland GmbHOracleDB + AQConfig change @Runtimexml-route-EAI-Nodeinterpret relevance of control messageEAI-NodeEAI-Nodectrl-queue3. upon control message arrivalAdmin UI
© 2014 innoQ Deutschland GmbHOracleDB + AQConfig change @Runtimexml-route-EAI-Nodeaffected nodes reload configurationEAI-NodeEAI-Nodectrl-queueinterpret relevance of control messageAdmin UI3. upon control message arrival
© 2014 innoQ Deutschland GmbHOracleDB + AQAdmin UILessons Learned?xml-route-EAI-NodeEAI-NodeEAI-Nodectrl-queue
© 2014 innoQ Deutschland GmbHTestbarkeit vs. Konfigurierbarkeit?
© 2014 innoQ Deutschland GmbHTestbarkeit und Konfigurierbarkeit
© 2013 innoQ Deutschland GmbHMessage Ordering
© 2013 innoQ Deutschland GmbHfrom(“ibmmq:QUEUE.IN“).noAutoStartup().transacted().policy(required).routeId(BasicRouteBuilder.stdfromRouteId(this.componentBaseName)).process(vslHeadersProcessor).setHeader(HDR_DUMMYCOMPLCHK_IBR, constant(PASSEDMSG)).bean(inboundTargetDispatcherBean).wireTap("seda:inboundRouter.log");Message Ordering
© 2013 innoQ Deutschland GmbHSpringTransactionPolicy required = lookup("PROPAGATION_REQUIRED",SpringTransactionPolicy.class);for (int i = 0; i < NROFROUTES; i++) {String iasS = String.valueOf(i);from(fromEndpoint.replaceAll("§", iasS)).noAutoStartup().transacted().policy(required).routeId(KONTO_ZP_PREROUTEID + iasS).process(new CheckRedeliveryProcessor()).process(new ZahlplanFacetConverter()).bean(zpBean, "process").to("bean:kontostatctr?method=stopCounter").wireTap(logEndpoint);}Message Ordering
© 2014 innoQ Deutschland GmbHDoes it save money?
© 2014 innoQ Deutschland GmbHBackward compatibility via EAI
© 2013 innoQ Deutschland GmbHTransformation mit BPMN-System (1)
© 2013 innoQ Deutschland GmbHTransformation für BPMN-System (2)
© 2013 innoQ Deutschland GmbHTransformation für BPMN-System (3)
© 2014 innoQ Deutschland GmbH
© 2014 innoQ Deutschland GmbHShould I always use an EAI-Framework?
© 2014 innoQ Deutschland GmbHShould I always use an EAI-Framework?It depends!
© 2014 innoQ Deutschland GmbHScenario: Kilogramm vs. Stück
© 2014 innoQ Deutschland GmbHLagerverwalt-ungssystemTouren-planungEin Integrationsproblem?Produktionssystem
© 2014 innoQ Deutschland GmbHLagerverwalt-ungssystemTouren-planungEin Integrationsproblem?ProduktionssystemKgKgKg Kg Stck
© 2014 innoQ Deutschland GmbHLagerverwalt-ungssystemTouren-planungKein IntegrationsproblemProduktionssystemKgKgStck Stck Stck
© 2014 innoQ Deutschland GmbHFurther tips considering EAI
© 2014 innoQ Deutschland GmbHFurther tips considering EAIsmall building blocks
© 2014 innoQ Deutschland GmbHFurther tips considering EAIsmall building blocksno shared mutable state
© 2014 innoQ Deutschland GmbHFurther tips considering EAIsmall building blocksno shared mutable stateuse immutable DTOs
© 2014 innoQ Deutschland GmbHFurther tips considering EAIsmall building blocksno shared mutable stateuse immutable DTOs=> increased scalability
© 2014 innoQ Deutschland GmbHFurther tips considering EAIsmall building blocksno shared mutable stateuse immutable DTOs=> increased scalabilityadvanced: see “SEDA” & “actor model”
We take care of it - personally!© 2014 innoQ Deutschland GmbHAlexander Heusingfeld, @goldstift[email protected]Martin Huber, @waterback[email protected]http://www.innoq.com/de/talksVielen Dank!