Building a Service Oriented Architecture with the Apache Servicemix ESB Bruce Snyder IONA Technologies
Total Page:16
File Type:pdf, Size:1020Kb
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Building a Service Oriented Architecture with the Apache ServiceMix ESB Bruce Snyder IONA Technologies Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 1 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies How is SOA Like Cycling Up a Mountain? - Break down large tasks into smaller ones! -- Bite size pieces are more realistic -- Many small goals instead of one big one Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 2 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Build on Many Small Successes to Reach Your Goal! - Build on many small successes to reach your goal Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 3 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Breaking Down the Problem is Half the Battle... - SOA is: -- An architectural paradigm - SOA is not: -- A product -- One size fits all - Smaller, more distinct, distributed and reusable units of logic called services - Composite services - aggregate of - Designed to better withstand unpredictable change Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 4 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Service compositions are about a coordinated aggregate of services - Loose coupling - Service contracts - Autonomy - Abstraction - Reusability - Composability - Statelessness - Discoverability Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 5 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Services Form Composite Applications - SOA is all about composite applications -- Many reusable services aggregated into a service composition Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 6 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies A Service Oriented Analogy - Gated community in a home owners assoc. -- Provides services (grounds maintenance, cable TV, security, clubhouse w/ pool, etc.) -- Used by many people (consumers) -- HOA community is comprised of many owners -- Adherence to basic conventions --- HOA requirements --- Address on house --- Mailbox at end of driveway --- Pay dues! Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 7 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies A story about skydiving... - Michael Holmes - Top ten skydiver in the world - Member of the British skydiving team - Reigning New Zealand champion - 7,000+ jumps to his name - Aware of the risks of his career - Knows that panic-induced human error is to blame for almost all accidents Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 8 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies “I didn’t have time to think about anything... really I was just angry that I’d done everything exactly as I should and it hadn’t worked.” - Michael plummeted 12,000 ft. to a failed parachute Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 9 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies There’s no substitute for experience and knowledge of human organizational behavior in terms of SOA - People use their experience even if it doesn't apply to the current situation -- See Harwells Laws -- http://www.makingitclear.com/pages/harwellslaws.html - Industry full of hope that is pinned on cookbook SOA methodologies -- There is no one-size-fits-all SOA recipe! --- Follow this recipe and you’ll be safe --- Go through the following 10 steps and your SOA will be a success. - You might end up being, “angry that you’d done everything exactly as you should and it still didn’t work!” Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 10 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Java Business Integration - Standards based architecture for pluggable components in a reliable manner - Elimination of vendor lock-in - Provides a base for a service oriented architecture - JBI allows two types of plug-ins: -- Service Engines --- Provides functionality local to the NMR -- Binding Components --- Provides transports and protocols to communicate with services remote to the NMR --- Normalizes payload Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 11 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies JBI Packaging - Packaging for configurations of components -- Service Unit (SU) --- META-INF/jbi.xml -- Service Assembly (SA) --- META-INF/jbi.xml --Similar to WARs and EARs with Java EE - Each SU is like a little Spring application -- Including dependencies - Each SA is an outer package -- SUs listed as dependencies Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 12 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Apache ServiceMix -- Apache License 2.0 -- Combines SOA and Event Driven Architecture --- http://enterpriseintegrationpatterns.com/docs/EDA.pdf -- Built on Apache ActiveMQ -- Implements JBI and so much more! -- Connectivity centric -- Smart Routing capabilities -- It’s very flexible! Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 13 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Apache ServiceMix Architecture Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 14 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Configuration . (conf/servicemix.xml) Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 15 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Developing Integrations With ServiceMix Demo Development demo using ServiceMix Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 16 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Visualization Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 17 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies So What’s Coming in ServiceMix 4.0? Framework: OSGi (Apache Felix) SOAP Support: Apache CXF Message Broker: Apache ActiveMQ Routing Engine: Apache Camel Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 18 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies What is Apache Camel? Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 19 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies What is EIP? - The bible of integration patterns Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 20 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Example Pattern: Content Based Router RouteBuilder builder = new RouteBuilder() { public void configure() { from("seda:a").choice().when(header ("foo").isEqualTo("bar")).to("seda:b") .when(header("foo").isEqualTo ("cheese")).to("seda:c").otherwise().to ("seda:d"); } }; - The Java version of the Camel CBR Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 21 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Example Pattern: Content Based Router <camelContext id="buildSimpleRouteWithChoice" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="seda:a"/> <choice> <when> <predicate> <header name="foo"/> <isEqualTo value="bar"/> </predicate> <to uri="seda:b"/> </when> <when> <predicate> <header name="foo"/> <isEqualTo value="cheese"/> </predicate> <to uri="seda:c"/> </when> <otherwise><to uri="seda:d"/></otherwise> </choice> </route> </camelContext> - The XML version of the CBR Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 22 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Camel Makes Routing Much Easier! from(“http://localhost:8080/requests/”). tryBlock(). to(“activemq:queue:requests”). setOutBody(constant(“<ack/>”)). handle(Throwable.class). setFaultBody(constant(“<nack/>”)); from((“activemq:queue:requests?transacted=true”). process(requestTransformer). to(“http://host:8080/Request”). filter(xpath(“//nack”)). process(nackTransformer). to(“jdbc:store”); from(“http://localhost:8080/responses/”). tryBlock(). to(“activemq:queue:responses”). setOutBody(constant(“<ack/>”)). handle(Throwable.class). setFaultBody(constant(“<nack/>”)); from(“activemq:queue:responses?transacted=true”). process(responseTransformer). to(“jdbc:store”); from(“http://localhost:8080/pull/”). to(“jdbc:load”); - Message routing is much easier with Camel! Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 23 Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Thank You for Attending Please fill out your surveys Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 24.