service oriented integration with servicemix
DESCRIPTION
Presented to Colorado Springs Open Source Users Group on April 28, 2008 by William Henry.TRANSCRIPT
![Page 1: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/1.jpg)
Service Oriented IntegrationWith Apache ServiceMix
William G Henry [email protected] By Bruce Snyder [email protected]
![Page 2: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/2.jpg)
2
Agenda
Enterprise Service Bus Java Business Integration Apache ServiceMix ESB Apache Camel (intro)
![Page 3: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/3.jpg)
3
What isanESB?
![Page 4: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/4.jpg)
4
What is an ESB?
"An Enterprise Service Bus (ESB) is a new architecture that exploits Webservices, messaging middleware, intelligent routing, and transformation. ESBsact as a lightweight, ubiquitous integration backbone through which softwareservices and application components flow.” (Gartner)
"An Enterprise Service Bus (ESB) is a new architecture thatexploits Web services, messaging middleware, intelligentrouting, and transformation. ESBs act as a lightweight,ubiquitous integration backbone through which softwareservices and application components flow.” (Gartner)
![Page 5: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/5.jpg)
5
What is an ESB?
An ESB acts as a shared messaging layer for connecting applications and otherservices throughout an enterprise computing infrastructure. It supplements itscore asynchronous messaging backbone with intelligent transformation androuting to ensure messages are passed reliably. Services participate in the ESBusing either web services messaging standards or JMS (LooselyCoupled.com)
An ESB acts as a shared messaging layer for connectingapplications and other services throughout an enterprisecomputing infrastructure. It supplements its coreasynchronous messaging backbone with intelligenttransformation and routing to ensure messages are passedreliably. Services participate in the ESB using either webservices messaging standards or JMS (LooselyCoupled.com)
![Page 6: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/6.jpg)
6
What is an ESB?
An ESB is an open standards, message-based, distributed, integration solutionthat provides routing, invocation, and mediation services to facilitate theinteractions of disparate distributed information technology resources(applications, services, information, platforms) in a reliable manner. (BrendaMichelson, Elemental Links)
An ESB is an open standards, message-based, distributed,integration solution that provides routing, invocation, andmediation services to facilitate the interactions of disparatedistributed information technology resources (applications,services, information, platforms) in a reliable manner. (BrendaMichelson, Elemental Links)
![Page 7: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/7.jpg)
7
Do I need an ESB?
ESB Planning Process
![Page 8: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/8.jpg)
8
WhatisJBI?
![Page 9: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/9.jpg)
9
What is JBI?
JBI defines an architecture that allows theconstruction of integration systems fromplug-in components, that interoperatethrough the method of mediated messageexchange.
(JBI 1.0 Spec)
![Page 10: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/10.jpg)
10
Java Business Integration
![Page 11: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/11.jpg)
11
Java Business Integration
![Page 12: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/12.jpg)
12
JBI Normalized Message
![Page 13: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/13.jpg)
13
JBI Packaging
![Page 14: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/14.jpg)
14
Apache ServiceMix
http://servicemix.apache.org/
![Page 15: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/15.jpg)
15
Apache ServiceMix Architecture
![Page 16: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/16.jpg)
16
ServiceMix Features
Supports many protocols File, FTP, HTTP/S, JMS, SMTP, SOAP, TCP, XMPP
Support many engines Apache Camel, Apache CXF, Apache ODE, Drools,
OS Workflow, POJOs, Quartz, Scripting, SaxonXQuery and XSLT, WS-Notification
Support for Security JAAS, WS-Security
Web Container/App Server Integration Geronimo, JBoss, Jetty, Tomcat, Weblogic,
Websphere
![Page 17: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/17.jpg)
17
Apache Software Foundation
ApacheSoftwareFoundation
![Page 18: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/18.jpg)
18
Message Routing
![Page 19: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/19.jpg)
19
Message Routing
![Page 20: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/20.jpg)
20
Example
![Page 21: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/21.jpg)
21
Configuration
![Page 22: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/22.jpg)
22
file-poller-su
<beans xmlns:file='http://servicemix.apache.org/file/1.0' xmlns:myApp="http://com.mycompany/myapp">
<file:poller service="myapp:file" endpoint="poller" file="file:///Users/bsnyder/poller/inbox" targetService="myapp:wiretap" targetEndpoint="logger" /> </beans>
![Page 23: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/23.jpg)
23
eip-wiretap-su
<beans xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:myapp="http://mycompany.com/myapp">
<eip:wire-tap service="myapp:wiretap" endpoint="endpoint"> <eip:target> <eip:exchange-target service="myapp:cbr" /> </eip:target> <eip:inListener> <eip:exchange-target service="myapp:persist" /> </eip:inListener> </eip:wire-tap>
</beans>
23
![Page 24: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/24.jpg)
24
camel-persist-su
public class PersistOrderRoute extends RouteBuilder { public void configure() { from("jbi:endpoint:http://mycompany.com/persist/order") .convertBodyTo(Order.class) .to("jpa:com.mycompany.Order?persistenceUnit=order-
proc") .convertBodyTo(Order.class); }}
-------------------------------------------------
<beans xmlns:camel=”http://activemq.apache.org/camel"> <camel:camelContext id="camel"> <package>com.mycompany.persistence</package> </camel:camelContext> </beans>
24
![Page 25: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/25.jpg)
25
eip-cbr-su
<beans xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:myapp="http://mycompany.com/myapp">
<eip:content-based-router service="myapp:cbr" endpoint="endpoint"> <eip:rules> <eip:routing-rule> <eip:predicate> <eip:xpath-predicate xpath="/message/cheese/text() = 'gouda'" /> </eip:predicate> <eip:target> <eip:exchange-target service="myapp:queue1" /> </eip:target> </eip:routing-rule> ...
![Page 26: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/26.jpg)
26
eip-cbr-su
... <eip:routing-rule> <eip:predicate> <eip:xpath-predicate xpath="/message/cheese/text() = 'swiss'" /> </eip:predicate> <eip:target> <eip:exchange-target service="myapp:queue2" /> </eip:target> </eip:routing-rule> <eip:routing-rule> <eip:target> <eip:exchange-target service="myapp:queue3" /> </eip:target> </eip:routing-rule> </eip:rules> </eip:content-based-router>
26
![Page 27: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/27.jpg)
27
jms-producer-su
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" xmlns:myapp="http://mycompany.com/myapp xmlns:amq="http://activemq.org/config/1.0">
<jms:endpoint service="myapp:queue1" endpoint="myProvider" role="provider" destinationStyle="queue" jmsProviderDestinationName="queue1" connectionFactory="#connectionFactory" />
<jms:endpoint service="myapp:queue2" endpoint="myProvider" role="provider" destinationStyle="queue" jmsProviderDestinationName="queue2" connectionFactory="#connectionFactory"/>
27
![Page 28: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/28.jpg)
28
jms-producer-su
... <jms:endpoint service="myapp:queue3" endpoint="myProvider" role="provider" destinationStyle="queue" jmsProviderDestinationName="queue3" connectionFactory="#connectionFactory"/>
<amq:connectionFactory id="connectionFactory" brokerURL="tcp://localhost:61616" />
</beans>
![Page 29: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/29.jpg)
29
JBI Packaging
![Page 30: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/30.jpg)
30
Distribution of ServiceMix Containers
![Page 31: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/31.jpg)
31
Eclipse IDE Tooling For ServiceMix
Eclipse SOA Tools Platform (STP) Project
Eclipse SOA Tooling Platform (STP)Project http://eclipse.org/stp
IONA FUSE Eclipse Tooling http://open.iona.com/wiki/display/ProdInfo/FUSE+Eclipse+Tools
Spagic http://spagic.com/
Sopera http://sopera.de/en/products/sopera-servicemixtools/
![Page 32: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/32.jpg)
32
Eclipse Tooling
Eclipse SOA Tools Platform (STP) Project
![Page 33: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/33.jpg)
33
What is Apache Camel?
http://activemq.apache.org/camel/
![Page 34: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/34.jpg)
34
What is EIP?
![Page 35: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/35.jpg)
35
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"); }};
![Page 36: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/36.jpg)
36
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>
![Page 37: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/37.jpg)
37
What’s Coming in ServiceMix 4.0
ApacheServiceMix4.0
![Page 38: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/38.jpg)
38
ServiceMix 4.0 Building Blocks
Runtime: OSGi (Apache Felix) JBI support still intact! NMR is a OSGi service
Message Broker: Apache ActiveMQ Web Services: Apache CXF Routing Engine: Apache Camel
![Page 39: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/39.jpg)
39
Thank You for Attending!
Questions?
![Page 40: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/40.jpg)
40
Visualization
![Page 41: Service Oriented Integration with ServiceMix](https://reader034.vdocuments.us/reader034/viewer/2022051323/5478abcd5906b55d048b45a5/html5/thumbnails/41.jpg)
41
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”);