Building a Service Oriented Architecture with the Apache
Transcript of Building a Service Oriented Architecture with the Apache
Bruce SnyderIONA Technologies
Building a Service Oriented Architecture with the Apache ServiceMix ESB
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 1
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
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 2
Build on Many Small Successes to Reach Your Goal!
- Build on many small successes to reach your goal
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 3
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
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 4
Service compositions are about a coordinated aggregate of services
- Loose coupling- Service contracts- Autonomy - Abstraction- Reusability - Composability- Statelessness- Discoverability
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 5
Services Form Composite Applications
- SOA is all about composite applications -- Many reusable services aggregated into a service composition
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 6
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!
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 7
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
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 8
“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
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 9
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!”
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 10
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
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 11
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
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 12
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!
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 13
Apache ServiceMix Architecture
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 14
Configuration
(conf/servicemix.xml)
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 15
Developing Integrations With ServiceMix Demo
Development demo using ServiceMix
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 16
Visualization
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 17
So What’s Coming in ServiceMix 4.0?
Framework: OSGi (Apache Felix)SOAP Support: Apache CXFMessage Broker: Apache ActiveMQRouting Engine: Apache Camel
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 18
What is Apache Camel?
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 19
What is EIP?
- The bible of integration patterns
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 20
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
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 21
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
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 22
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!
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 23
Thank You for Attending
Please fill out your surveys
Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies
Bruce Snyder — Building a Service Oriented Architecture with the Apache ServiceMix ESB Slide 24