Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Flexible EAI-Lösungen mit GlassFish

Flexible EAI-Lösungen mit GlassFish

Vortrag beim DOAG SIG Middleware GlassFish Event mit Martin Huber (@waterback). http://www.doag.org/termine/termine.php?tid=450909

Alexander Heusingfeld

October 08, 2013
Tweet

More Decks by Alexander Heusingfeld

Other Decks in Programming

Transcript

  1. We take care of it - personally!
    © 2013 innoQ Deutschland GmbH
    Flexible EAI-Lösungen mit Glassfish
    Praxisbeispiele und War Stories zu EAI-Pattern
    Alexander Heusingfeld, @goldstift
    Martin Huber, @waterback
    Tuesday 8 October 13

    View full-size slide

  2. © 2013 innoQ Deutschland GmbH
    Tuesday 8 October 13

    View full-size slide

  3. © 2013 innoQ Deutschland GmbH
    EAI Pattern in 2013?
    Tuesday 8 October 13

    View full-size slide

  4. © 2013 innoQ Deutschland GmbH
    EAI Pattern in 2013?
    Nobody does that anymore!
    Tuesday 8 October 13

    View full-size slide

  5. © 2013 innoQ Deutschland GmbH
    That’s THE problem!
    Tuesday 8 October 13

    View full-size slide

  6. © 2013 innoQ Deutschland GmbH
    Multitude of potential service consumers
    Integration is ubiquitous
    CRM
    Application
    Tuesday 8 October 13

    View full-size slide

  7. © 2013 innoQ Deutschland GmbH
    Multitude of potential service consumers
    Integration is ubiquitous
    CRM
    Application
    ERP
    Application
    Tuesday 8 October 13

    View full-size slide

  8. © 2013 innoQ Deutschland GmbH
    Multitude of potential service consumers
    Integration is ubiquitous
    CRM
    Application
    ?
    Tuesday 8 October 13

    View full-size slide

  9. © 2013 innoQ Deutschland GmbH
    Multitude of potential service consumers
    Integration is ubiquitous
    CRM
    Application
    Tuesday 8 October 13

    View full-size slide

  10. © 2013 innoQ Deutschland GmbH
    Patterns? Wasn’t there a book?
    Tuesday 8 October 13

    View full-size slide

  11. © 2013 innoQ Deutschland GmbH
    Patterns? Wasn’t there a book?
    Design Patterns (Gamma et al), 1994
    Tuesday 8 October 13

    View full-size slide

  12. © 2013 innoQ Deutschland GmbH
    Patterns? Wasn’t there a book?
    Design Patterns (Gamma et al), 1994
    Proven solutions for common problems
    Tuesday 8 October 13

    View full-size slide

  13. © 2013 innoQ Deutschland GmbH
    Patterns? Wasn’t there a book?
    Design Patterns (Gamma et al), 1994
    Proven solutions for common problems
    Enterprise Integration Patterns (Hohpe & Woolf), 2003
    Tuesday 8 October 13

    View full-size slide

  14. © 2013 innoQ Deutschland GmbH
    Patterns? Wasn’t there a book?
    Design Patterns (Gamma et al), 1994
    Proven solutions for common problems
    Enterprise Integration Patterns (Hohpe & Woolf), 2003
    Swiss-army knife for asynchronous messaging
    Tuesday 8 October 13

    View full-size slide

  15. © 2013 innoQ Deutschland GmbH
    Patterns? Wasn’t there a book?
    Design Patterns (Gamma et al), 1994
    Proven solutions for common problems
    Enterprise Integration Patterns (Hohpe & Woolf), 2003
    Swiss-army knife for asynchronous messaging
    www.eaipatterns.com
    Tuesday 8 October 13

    View full-size slide

  16. © 2013 innoQ Deutschland GmbH
    “We all believe that asynchronous
    messaging carries the greatest promise.”
    - Martin Fowler (Foreword of Enterprise Integration Patterns, 2003)
    Tuesday 8 October 13

    View full-size slide

  17. © 2013 innoQ Deutschland GmbH
    MESSAGING?
    http://bit.ly/PtrhWy
    Tuesday 8 October 13

    View full-size slide

  18. © 2013 innoQ Deutschland GmbH
    Benefits of async. Messaging
    Tuesday 8 October 13

    View full-size slide

  19. © 2013 innoQ Deutschland GmbH
    Benefits of async. Messaging
    decoupled
    Tuesday 8 October 13

    View full-size slide

  20. © 2013 innoQ Deutschland GmbH
    Benefits of async. Messaging
    decoupled
    integrated platforms/ languages
    Tuesday 8 October 13

    View full-size slide

  21. © 2013 innoQ Deutschland GmbH
    Benefits of async. Messaging
    decoupled
    integrated platforms/ languages
    reliable communication
    Tuesday 8 October 13

    View full-size slide

  22. © 2013 innoQ Deutschland GmbH
    Benefits of async. Messaging
    decoupled
    integrated platforms/ languages
    reliable communication
    disconnected
    Tuesday 8 October 13

    View full-size slide

  23. © 2013 innoQ Deutschland GmbH
    Benefits of async. Messaging
    decoupled
    integrated platforms/ languages
    reliable communication
    disconnected
    throttled
    Tuesday 8 October 13

    View full-size slide

  24. We take care of it - personally!
    © 2013 innoQ Deutschland GmbH
    But why those Patterns?
    Tuesday 8 October 13

    View full-size slide

  25. © 2013 innoQ Deutschland GmbH
    Thoughts on EAI patterns
    Tuesday 8 October 13

    View full-size slide

  26. © 2013 innoQ Deutschland GmbH
    Thoughts on EAI patterns
    not invented, but observed
    Tuesday 8 October 13

    View full-size slide

  27. © 2013 innoQ Deutschland GmbH
    Thoughts on EAI patterns
    not invented, but observed
    don’t solve everything
    Tuesday 8 October 13

    View full-size slide

  28. © 2013 innoQ Deutschland GmbH
    Thoughts on EAI patterns
    not invented, but observed
    don’t solve everything
    provide ideas
    Tuesday 8 October 13

    View full-size slide

  29. © 2013 innoQ Deutschland GmbH
    Thoughts on EAI patterns
    not invented, but observed
    don’t solve everything
    provide ideas
    good ones evolve
    Tuesday 8 October 13

    View full-size slide

  30. © 2013 innoQ Deutschland GmbH
    Thoughts on EAI patterns
    not invented, but observed
    don’t solve everything
    provide ideas
    good ones evolve
    changes are incorporated at eaipatterns.com
    Tuesday 8 October 13

    View full-size slide

  31. © 2013 innoQ Deutschland GmbH
    Simple order management system (CRUD)
    Real Life Scenario
    order
    management
    system
    Tuesday 8 October 13

    View full-size slide

  32. © 2013 innoQ Deutschland GmbH
    Simple order management system (CRUD)
    Real Life Scenario
    order
    management
    system
    • basic Java EE
    Tuesday 8 October 13

    View full-size slide

  33. © 2013 innoQ Deutschland GmbH
    Simple order management system (CRUD)
    Real Life Scenario
    order
    management
    system
    • basic Java EE
    • Just CRUD operations
    Tuesday 8 October 13

    View full-size slide

  34. © 2013 innoQ Deutschland GmbH
    Simple order management system (CRUD)
    Real Life Scenario
    order
    management
    system
    • basic Java EE
    • Just CRUD operations
    • “information silo”
    Tuesday 8 October 13

    View full-size slide

  35. © 2013 innoQ Deutschland GmbH
    Simple order management system (CRUD)
    Real Life Scenario
    order
    management
    system
    • basic Java EE
    • Just CRUD operations
    • “information silo”
    Tuesday 8 October 13

    View full-size slide

  36. © 2013 innoQ Deutschland GmbH
    Simple Change
    order
    management
    system
    Tuesday 8 October 13

    View full-size slide

  37. © 2013 innoQ Deutschland GmbH
    Enhance the system with an importer!
    Simple Change
    order
    management
    system
    Tuesday 8 October 13

    View full-size slide

  38. © 2013 innoQ Deutschland GmbH
    Enhance the system with an importer!
    Simple Change
    • Receive CSV-data via HTTP POST
    order
    management
    system
    Tuesday 8 October 13

    View full-size slide

  39. © 2013 innoQ Deutschland GmbH
    Enhance the system with an importer!
    Simple Change
    • Receive CSV-data via HTTP POST
    • CSV contains header and detail records
    order
    management
    system
    Tuesday 8 October 13

    View full-size slide

  40. © 2013 innoQ Deutschland GmbH
    Enhance the system with an importer!
    Simple Change
    • Receive CSV-data via HTTP POST
    • CSV contains header and detail records
    • Import data into database
    order
    management
    system
    Tuesday 8 October 13

    View full-size slide

  41. © 2013 innoQ Deutschland GmbH
    A Simple Java EE sample
    @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);
    }
    }
    }
    Tuesday 8 October 13

    View full-size slide

  42. © 2013 innoQ Deutschland GmbH
    Enhanced the system with an importer!
    System
    Simple Change done
    order
    management
    system
    HTTP
    csv
    Transform
    Business Partner
    Tuesday 8 October 13

    View full-size slide

  43. © 2013 innoQ Deutschland GmbH
    Integrate the system of a forwarder
    System
    Change happens
    order
    management
    system
    HTTP
    csv
    Transform
    Business Partner
    forwarder
    system
    FTP
    SMTP
    SOAP WSSE
    REST
    Tuesday 8 October 13

    View full-size slide

  44. © 2013 innoQ Deutschland GmbH
    Recognize an integration task
    when it‘s staring in your face?
    Tuesday 8 October 13

    View full-size slide

  45. © 2013 innoQ Deutschland GmbH
    EASY!
    http://www.flickr.com/photos/wespionage/184793114
    Tuesday 8 October 13

    View full-size slide

  46. © 2013 innoQ Deutschland GmbH
    Build an easy and maintainable solution
    for multiple integration challenges?
    Tuesday 8 October 13

    View full-size slide

  47. © 2013 innoQ Deutschland GmbH
    NO PROBLEM!
    http://www.flickr.com/photos/mroach/3922903520/
    Tuesday 8 October 13

    View full-size slide

  48. © 2013 innoQ Deutschland GmbH
    Something wrong here?
    @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);
    }
    }
    }
    Tuesday 8 October 13

    View full-size slide

  49. © 2013 innoQ Deutschland GmbH
    Something wrong here?
    @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);
    }
    }
    }
    testable?
    Tuesday 8 October 13

    View full-size slide

  50. © 2013 innoQ Deutschland GmbH
    Something wrong here?
    @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);
    }
    }
    }
    testable?
    reusable?
    Tuesday 8 October 13

    View full-size slide

  51. © 2013 innoQ Deutschland GmbH
    Something wrong here?
    @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);
    }
    }
    }
    testable?
    reusable?
    extensible?
    Tuesday 8 October 13

    View full-size slide

  52. © 2013 innoQ Deutschland GmbH
    How could we do better?
    Tuesday 8 October 13

    View full-size slide

  53. © 2013 innoQ Deutschland GmbH
    Pipes and Filters
    http://www.enterpriseintegrationpatterns.com/PipesAndFilters.html
    Tuesday 8 October 13

    View full-size slide

  54. © 2013 innoQ Deutschland GmbH
    Pipes and Filters
    divide your task into small steps
    http://www.enterpriseintegrationpatterns.com/PipesAndFilters.html
    Tuesday 8 October 13

    View full-size slide

  55. © 2013 innoQ Deutschland GmbH
    Route
    Pipe
    Apply pipes & filters pattern
    Pipe
    outbound
    transform
    inbound
    Tuesday 8 October 13

    View full-size slide

  56. © 2013 innoQ Deutschland GmbH
    Route
    Pipe
    Apply pipes & filters pattern
    Pipe
    outbound
    transform
    inbound
    Servlet
    Tuesday 8 October 13

    View full-size slide

  57. © 2013 innoQ Deutschland GmbH
    Route
    Pipe
    Apply pipes & filters pattern
    Pipe
    outbound
    transform
    inbound
    Servlet Custom
    Tuesday 8 October 13

    View full-size slide

  58. © 2013 innoQ Deutschland GmbH
    Route
    Pipe
    Apply pipes & filters pattern
    Pipe
    outbound
    transform
    inbound
    Servlet Custom JPA
    Tuesday 8 October 13

    View full-size slide

  59. © 2013 innoQ Deutschland GmbH
    When you got the right tools to do the job?
    Tuesday 8 October 13

    View full-size slide

  60. © 2013 innoQ Deutschland GmbH
    INFALLIBLE!
    http://www.flickr.com/photos/ohskylab/4547693502
    Tuesday 8 October 13

    View full-size slide

  61. © 2013 innoQ Deutschland GmbH
    Is there something simpler?
    Tuesday 8 October 13

    View full-size slide

  62. © 2013 innoQ Deutschland GmbH
    ADAPTERS?
    http://www.flickr.com/photos/mroach/3922903520/
    Property of ChinBuye Limited. http://bit.ly/xBKwGw
    Tuesday 8 October 13

    View full-size slide

  63. © 2013 innoQ Deutschland GmbH
    EAI Frameworks
    Apache Camel Spring Integration
    Tuesday 8 October 13

    View full-size slide

  64. © 2013 innoQ Deutschland GmbH
    A simple camel route
    from("jetty:http://localhost:9080/order/import")
    .routeId(“orderimport”)
    .process(new PostParameterProcessor(“csvdata”))
    .process(new StringRemover(new String[]{"\""}))
    .unmarshal().csv()
    .split(body(List.class))
    .aggregate(header("orderId"), new
    MySpecialAggregationStrategy()).completionTimeout(3000)
    .to("seda:singlepartsroute");
    Tuesday 8 October 13

    View full-size slide

  65. © 2013 innoQ Deutschland GmbH
    Spring Integration sample
    ! id="orderImportHttpAdapter"
    ! path="/order/import” supported-methods="POST"
    ! channel="ordersIn"/>

    method="split" output-channel="ordersToDB" />
    class="com.innoq.samples.eai.OrderSplitter"/>

    request-channel="ordersToDB"
    entity-class="com.innoq.samples.eai.domain.Order"
    entity-manager="em"/>
    Tuesday 8 October 13

    View full-size slide

  66. © 2013 innoQ Deutschland GmbH
    Configuration in XML?
    Tuesday 8 October 13

    View full-size slide

  67. © 2013 innoQ Deutschland GmbH
    Configuration in XML?
    Tuesday 8 October 13

    View full-size slide

  68. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Admin UI
    Real-life scenario: Control Bus
    xml-route-config
    EAI-Node
    EAI-Node
    EAI-Node
    ctrl-queue
    Tomcat
    Embedded Jetty
    Tuesday 8 October 13

    View full-size slide

  69. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Real-life scenario: Control Bus
    xml-route-config
    EAI-Node
    database connection
    EAI-Node
    EAI-Node
    ctrl-queue
    Initial Node configuration
    node type (command line arg)
    Admin UI
    Tuesday 8 October 13

    View full-size slide

  70. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Real-life scenario: Control Bus
    xml-route-config
    EAI-Node
    subscribe to control queue
    EAI-Node
    EAI-Node
    ctrl-queue
    1. Server startup
    Admin UI
    Tuesday 8 October 13

    View full-size slide

  71. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Real-life scenario: Control Bus
    xml-route-config
    EAI-Node
    load node-type specific config
    EAI-Node
    EAI-Node
    ctrl-queue
    subscribe to control queue
    1. Server startup
    Admin UI
    Tuesday 8 October 13

    View full-size slide

  72. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Config change @Runtime
    xml-route-config
    EAI-Node
    EAI-Node
    EAI-Node
    ctrl-queue
    2. during runtime
    route config is changed
    Admin UI
    Tuesday 8 October 13

    View full-size slide

  73. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Config change @Runtime
    xml-route-config
    EAI-Node
    EAI-Node
    EAI-Node
    ctrl-queue
    2. during runtime
    route config is changed
    publish config update message
    Admin UI
    Tuesday 8 October 13

    View full-size slide

  74. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Config change @Runtime
    xml-route-config
    EAI-Node
    interpret relevance of control message
    EAI-Node
    EAI-Node
    ctrl-queue
    3. upon control message arrival
    Admin UI
    Tuesday 8 October 13

    View full-size slide

  75. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Config change @Runtime
    xml-route-config
    EAI-Node
    affected nodes reload configuration
    EAI-Node
    EAI-Node
    ctrl-queue
    interpret relevance of control message
    3. upon control message arrival
    Admin UI
    Tuesday 8 October 13

    View full-size slide

  76. © 2013 innoQ Deutschland GmbH
    OracleDB + AQ
    Admin UI
    What would we change today?
    xml-route-config
    EAI-Node
    EAI-Node
    EAI-Node
    ctrl-queue
    GlassFish 4.0
    Tuesday 8 October 13

    View full-size slide

  77. © 2013 innoQ Deutschland GmbH
    More EAI-Patterns
    in the wild
    Tuesday 8 October 13

    View full-size slide

  78. © 2013 innoQ Deutschland GmbH
    Message Router
    http://www.enterpriseintegrationpatterns.com/MessageRouter.html
    Tuesday 8 October 13

    View full-size slide

  79. © 2013 innoQ Deutschland GmbH
    Message Router
    forward by condition
    http://www.enterpriseintegrationpatterns.com/MessageRouter.html
    Tuesday 8 October 13

    View full-size slide

  80. © 2013 innoQ Deutschland GmbH
    Message Router
    http://www.enterpriseintegrationpatterns.com/MessageRouter.html
    Tuesday 8 October 13

    View full-size slide

  81. © 2013 innoQ Deutschland GmbH
    Message Router
    from(“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");
    Apache Camel running in WAS6.1
    Tuesday 8 October 13

    View full-size slide

  82. © 2013 innoQ Deutschland GmbH
    Message Router
    from(“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");
    Apache Camel running in WAS6.1
    Tuesday 8 October 13

    View full-size slide

  83. © 2013 innoQ Deutschland GmbH
    Message Router
    http://www.eaipatterns.com/MessageRouter.html
    public class InboundTargetMsgDispatcherBean implements Constants {
    /**
    * Map for all eligible Target Endpoints of the InboundRouter.
    */
    private final Map allTargets = new HashMap(NROFROUTES);
    ...
    @RecipientList
    public String[] route(@Header(HDR_JMSX_GROUPID) String group) {
    String[] t = allTargets.get(group);
    return t;
    }
    /**
    * creates valid endpoint-uris from targetJMSUri and numbering.
    */
    private void createAllTargets() {
    if (allTargets.keySet().size() == 0) {
    for (int i = 0; i < NROFROUTES; i++) {
    String target = createTargetJMSUri(i);
    allTargets.put(String.valueOf(i), new String[] { target });
    }
    }
    }
    Tuesday 8 October 13

    View full-size slide

  84. © 2013 innoQ Deutschland GmbH
    Transformer
    www.enterpriseintegrationpatterns.com/MessageTransformationIntro.html
    Tuesday 8 October 13

    View full-size slide

  85. © 2013 innoQ Deutschland GmbH
    Transformation mit BPMN-System (1)
    Tuesday 8 October 13

    View full-size slide

  86. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (2)
    from(“http://localhost:8080/authservice/proxy/transformed?bridgeEndpoint=true“)
    .routeId("bankapp.transformation.dispatch." + identification)
    .choice()
    .when().xpath("//v10:*[1]", inputNS)
    .to("direct:transform_v10_v11“)
    .otherwise()
    .to(outputEndpoint)
    .endChoice();
    Tuesday 8 October 13

    View full-size slide

  87. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (2)
    from(“http://localhost:8080/authservice/proxy/transformed?bridgeEndpoint=true“)
    .routeId("bankapp.transformation.dispatch." + identification)
    .choice()
    .when().xpath("//v10:*[1]", inputNS)
    .to("direct:transform_v10_v11“)
    .otherwise()
    .to(“http://localhost:8380/routingservice/proxy/” +
    “BPMNSystemSpecEP?bridgeEndpoint=true“)
    .endChoice();
    Tuesday 8 October 13

    View full-size slide

  88. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (2)
    from(“http://localhost:8080/authservice/proxy/transformed?bridgeEndpoint=true“)
    .routeId("bankapp.transformation.dispatch." + identification)
    .choice()
    .when().xpath("//v10:*[1]", inputNS)
    .to("direct:transform_v10_v11“)
    .otherwise()
    .to(“http://localhost:8380/routingservice/proxy/” +
    “BPMNSystemSpecEP?bridgeEndpoint=true“)
    .endChoice();
    Tuesday 8 October 13

    View full-size slide

  89. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (2)
    from(“http://localhost:8080/authservice/proxy/transformed?bridgeEndpoint=true“)
    .routeId("bankapp.transformation.dispatch." + identification)
    .choice()
    .when().xpath("//v10:*[1]", inputNS)
    .to("direct:transform_v10_v11“)
    .otherwise()
    .to(“http://localhost:8380/routingservice/proxy/” +
    “BPMNSystemSpecEP?bridgeEndpoint=true“)
    .endChoice();
    Tuesday 8 October 13

    View full-size slide

  90. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (3)
    from(“direct:transform_v10_v11“)
    .routeId("projectX.route.transformation.transform.v10_v11“)
    .setBody().xpath("/s:Envelope/s:Body/*[1]", soapNS)
    .to("xslt:xsl/BankX/Bank_v10_v11.xsl")
    .bean(XBankTransformerBean, "transform_v10_v11")
    .setBody().simple(TransformationConstants.soapStart +"$
    {in.body}"+TransformationConstants.soapEnd)
    .process(new ContentPrinter("v10-v11“))
    .inOut(“http://localhost:8380/routingservice/proxy/BPMNSystemSpecEP?“+
    „bridgeEndpoint=true“)
    .to("direct:response" + reverseidentification);
    Tuesday 8 October 13

    View full-size slide

  91. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (3)
    from(“direct:transform_v10_v11“)
    .routeId("projectX.route.transformation.transform.v10_v11“)
    .setBody().xpath("/s:Envelope/s:Body/*[1]", soapNS)
    .to("xslt:xsl/BankX/Bank_v10_v11.xsl")
    .bean(XBankTransformerBean, "transform_v10_v11")
    .setBody().simple(TransformationConstants.soapStart +"$
    {in.body}"+TransformationConstants.soapEnd)
    .process(new ContentPrinter("v10-v11“))
    .inOut(outputEndpoint)
    .to("direct:response" + reverseidentification);
    Tuesday 8 October 13

    View full-size slide

  92. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (3)
    from(“direct:transform_v10_v11“)
    .routeId("projectX.route.transformation.transform.v10_v11“)
    .setBody().xpath("/s:Envelope/s:Body/*[1]", soapNS)
    .to("xslt:xsl/BankX/Bank_v10_v11.xsl")
    .bean(XBankTransformerBean, "transform_v10_v11")
    .setBody().simple(TransformationConstants.soapStart +"$
    {in.body}"+TransformationConstants.soapEnd)
    .process(new ContentPrinter("v10-v11“))
    .inOut(outputEndpoint)
    .to("direct:response" + reverseidentification);
    Tuesday 8 October 13

    View full-size slide

  93. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (3)
    from(“direct:transform_v10_v11“)
    .routeId("projectX.route.transformation.transform.v10_v11“)
    .setBody().xpath("/s:Envelope/s:Body/*[1]", soapNS)
    .to("xslt:xsl/BankX/Bank_v10_v11.xsl")
    .bean(XBankTransformerBean, "transform_v10_v11")
    .setBody().simple(TransformationConstants.soapStart +"$
    {in.body}"+TransformationConstants.soapEnd)
    .process(new ContentPrinter("v10-v11“))
    .inOut(outputEndpoint)
    .to("direct:response" + reverseidentification);
    Tuesday 8 October 13

    View full-size slide

  94. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (3)
    from("direct:transform_v10_v11")
    .routeId("projectX.route.transformation.transform." + identification)
    .setBody().xpath("/s:Envelope/s:Body/*[1]", soapNS)
    .to("xslt:xsl/BankX/Bank_" + identification + ".xsl")
    .bean(transformerBean, "transform_v10_v11")
    ...
    public class BankTransformerBean extends AbstractTransformerBean {
    @SuppressWarnings({ "rawtypes" })
    public String transform_v10_v11(@Body String body) throws JDOMException,
    IOException {
    Element message = parse(body);
    message.removeNamespaceDeclaration(nsXBANK_v1_0);
    message.removeNamespaceDeclaration(nsYBANK_v1_0);
    message.addNamespaceDeclaration(nsXBANKv1_1);
    ....
    return toString(message);
    }
    @SuppressWarnings({ "rawtypes" })
    public String transform_v11_v10(@Body String body) throws JDOMException,
    IOException {
    Tuesday 8 October 13

    View full-size slide

  95. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (3)
    from(“direct:transform_v10_v11“)
    .routeId("projectX.route.transformation.transform.v10_v11“)
    .setBody().xpath("/s:Envelope/s:Body/*[1]", soapNS)
    .to("xslt:xsl/BankX/Bank_v10_v11.xsl")
    .bean(XBankTransformerBean, "transform_v10_v11")
    .setBody().simple(TransformationConstants.soapStart +"$
    {in.body}"+TransformationConstants.soapEnd)
    .process(new ContentPrinter("v10-v11“))
    .inOut(“http://localhost:8380/routingservice/proxy/BPMNSystemSpecEP?“+
    „bridgeEndpoint=true“)
    .to("direct:response_v11_v10“);
    Tuesday 8 October 13

    View full-size slide

  96. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (3)
    from(“direct:transform_v10_v11“)
    .routeId("projectX.route.transformation.transform.v10_v11“)
    .setBody().xpath("/s:Envelope/s:Body/*[1]", soapNS)
    .to("xslt:xsl/BankX/Bank_v10_v11.xsl")
    .bean(XBankTransformerBean, "transform_v10_v11")
    .setBody().simple(TransformationConstants.soapStart +"$
    {in.body}"+TransformationConstants.soapEnd)
    .process(new ContentPrinter("v10-v11“))
    .inOut(“http://localhost:8380/routingservice/proxy/BPMNSystemSpecEP?“+
    „bridgeEndpoint=true“)
    .to("direct:response_v11_v10“);
    Tuesday 8 October 13

    View full-size slide

  97. © 2013 innoQ Deutschland GmbH
    Transformation für BPMN-System (4)
    from("direct:response_v11_v10“)
    .setBody().xpath("/s:Envelope/s:Body/*[1]", soapNS)
    .to("xslt:xsl/BankX/Bank_v11_v10.xsl")
    .bean(transformerBean, "transform_v11_v10")
    .setBody().simple(TransformationConstants.soapStartTixBank +"${in.body}"
    +TransformationConstants.soapEnd);
    Tuesday 8 October 13

    View full-size slide

  98. © 2013 innoQ Deutschland GmbH
    Route
    Pipe
    Flexibility through Filters
    Pipe
    outbound
    filter
    inbound
    Filters are exchangeable,
    reusable and easily testable
    Tuesday 8 October 13

    View full-size slide

  99. © 2013 innoQ Deutschland GmbH
    Tuesday 8 October 13

    View full-size slide

  100. © 2013 innoQ Deutschland GmbH
    Should I always use an EAI-Framework?
    Tuesday 8 October 13

    View full-size slide

  101. © 2013 innoQ Deutschland GmbH
    Should I always use an EAI-Framework?
    It depends!
    Tuesday 8 October 13

    View full-size slide

  102. © 2013 innoQ Deutschland GmbH
    Further tips considering EAI
    Tuesday 8 October 13

    View full-size slide

  103. © 2013 innoQ Deutschland GmbH
    Further tips considering EAI
    small building blocks
    Tuesday 8 October 13

    View full-size slide

  104. © 2013 innoQ Deutschland GmbH
    Further tips considering EAI
    small building blocks
    no shared mutable state
    Tuesday 8 October 13

    View full-size slide

  105. © 2013 innoQ Deutschland GmbH
    Further tips considering EAI
    small building blocks
    no shared mutable state
    use immutable DTOs
    Tuesday 8 October 13

    View full-size slide

  106. © 2013 innoQ Deutschland GmbH
    Further tips considering EAI
    small building blocks
    no shared mutable state
    use immutable DTOs
    => increased scalability
    Tuesday 8 October 13

    View full-size slide

  107. © 2013 innoQ Deutschland GmbH
    Further tips considering EAI
    small building blocks
    no shared mutable state
    use immutable DTOs
    => increased scalability
    advanced: see “SEDA” & “actor model”
    Tuesday 8 October 13

    View full-size slide

  108. We take care of it - personally!
    © 2013 innoQ Deutschland GmbH
    Alexander Heusingfeld, @goldstift
    [email protected]
    Martin Huber, @waterback
    [email protected]
    http://www.innoq.com/de/talks
    Vielen Dank!
    Tuesday 8 October 13

    View full-size slide