service oriented integration with servicemix
DESCRIPTION
Presentation from ApacheCon US 2008TRANSCRIPT
![Page 1: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/1.jpg)
Service Oriented IntegrationWith Apache ServiceMix
Bruce [email protected] Nov 2008 New Orleans, Louisiana
![Page 2: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/2.jpg)
Agenda
• Enterprise Service Bus• Java Business Integration • Apache ServiceMix ESB • ServiceMix 4
![Page 3: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/3.jpg)
![Page 4: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/4.jpg)
Integration is Messy!
![Page 5: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/5.jpg)
![Page 6: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/6.jpg)
What is an ESB?
![Page 7: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/7.jpg)
"An Enterprise Service Bus (ESB) is a new architecture that exploits Web services, messaging middleware, intelligent routing, and transformation. ESBs act as a lightweight, ubiquitous integration backbone through which software services and application components flow.” (Gartner)
What is an ESB?
![Page 8: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/8.jpg)
What is an ESB?
An ESB acts as a shared messaging layer for connecting applications and other services throughout an enterprise computing infrastructure. It supplements its core asynchronous messaging backbone with intelligent transformation and routing to ensure messages are passed reliably. Services participate in the ESB using either web services messaging standards or JMS (LooselyCoupled.com)
![Page 9: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/9.jpg)
An ESB is an open standards, message-based, distributed, integration solution that provides routing, invocation, and mediation services to facilitate the interactions of disparate distributed information technology resources (applications, services, information, platforms) in a reliable manner. (Brenda Michelson, Elemental Links)
What is an ESB?
![Page 10: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/10.jpg)
Do I need an ESB?
ESB-oriented architecture: The wrong approach to adopting SOA
http://www.ibm.com/developerworks/webservices/library/ws-soa-esbarch/index.html?ca=drs-
![Page 11: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/11.jpg)
Use a Planning Process
ESB Planning Process
![Page 12: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/12.jpg)
What isJBI?
![Page 13: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/13.jpg)
What is JBI?
JBI defines an architecture that allows the construction of integration systems from plug-in components, that interoperate through the method of mediated message exchange. (JBI 1.0 Spec)
![Page 14: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/14.jpg)
Java Business Integration
![Page 15: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/15.jpg)
Java Business Integration
![Page 16: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/16.jpg)
JBI Normalized Message
![Page 17: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/17.jpg)
JBI Packaging
![Page 18: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/18.jpg)
Apache ServiceMix
http://servicemix.apache.org/
![Page 19: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/19.jpg)
Apache ServiceMix Architecture
![Page 20: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/20.jpg)
ServiceMix Features• Supports many protocols
– File, FTP, HTTP/S, JMS, SMTP, SOAP, TCP, XMPP
• Supports many engines– Apache Camel, Apache CXF, Apache ODE, Drools,
OS Workflow, POJOs, Quartz, Scripting, Saxon XQuery and XSLT, WS-Notification
• Supports Security – JAAS, WS-Security
• Web Container/App Server Integration– Geronimo, JBoss, Jetty, Tomcat, Weblogic,
Websphere
![Page 21: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/21.jpg)
Apache Software Foundation
![Page 22: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/22.jpg)
Message Routing
![Page 23: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/23.jpg)
Message Routing
![Page 24: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/24.jpg)
Example
![Page 25: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/25.jpg)
Configuration
![Page 26: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/26.jpg)
The File Poller
<beans xmlns:file='http://servicemix.apache.org/file/1.0' xmlns:test="urn:test">
<file:poller service="test:file" endpoint="endpoint" targetService="test:wiretapIn" file="/Users/bsnyder/smxdropbox">
</beans>
![Page 27: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/27.jpg)
The Wiretap<beans xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:test="urn:test" >
<eip:wire-tap service="test:wiretapIn" endpoint="endpoint"> <eip:target> <eip:exchange-target service="test:cbr" /> </eip:target> <eip:inListener> <eip:exchange-target service="test:logger" /> </eip:inListener> </eip:wire-tap>
</beans>
![Page 28: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/28.jpg)
The Logger
public class MyLogger extends RouteBuilder { public void configure() { from("jbi:service:urn:test:logger"). process(new Processor() { public void process(Exchange exchange) { Message in = exchange.getIn(); in.setBody(in.getBody(String.class) + "<foo>xxxxxxxxxxxxxxxxxxxxxxxxxxxx</foo>"); } }) to("log:demo"); }}
![Page 29: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/29.jpg)
The Logger<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <package>com.mycompany</package> </camelContext></beans>
![Page 30: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/30.jpg)
The Content-Based Router<beans xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:test="urn:test">
<eip:content-based-router service="test: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="test:queue1" /> </eip:target> </eip:routing-rule>...
![Page 31: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/31.jpg)
The Content-Based Router... <eip:routing-rule> <eip:predicate> <eip:xpath-predicate xpath="/message/cheese/text() = 'swiss'" /> </eip:predicate> <eip:target> <eip:exchange-target service="test:queue2" /> </eip:target> </eip:routing-rule> <eip:routing-rule> <eip:target> <eip:exchange-target service="test:queue3" /> </eip:target> </eip:routing-rule> </eip:rules> </eip:content-based-router>
![Page 32: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/32.jpg)
The JMS Sender<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" xmlns:test="urn:test” xmlns:amq="http://activemq.org/config/1.0">
<jms:endpoint service="test:queue1" endpoint="myProvider" role="provider" destinationStyle="queue" jmsProviderDestinationName="queue1" connectionFactory="#connectionFactory" />
<jms:endpoint service="test:queue2" endpoint="myProvider" role="provider" destinationStyle="queue" jmsProviderDestinationName="queue2" connectionFactory="#connectionFactory"/>
![Page 33: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/33.jpg)
The JMS Sender
... <jms:endpoint service="test:queue3" endpoint="myProvider" role="provider" destinationStyle="queue" jmsProviderDestinationName="queue3" connectionFactory="#connectionFactory"/>
<amq:connectionFactory id="connectionFactory" brokerURL="tcp://localhost:61616" />
</beans>
![Page 34: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/34.jpg)
Example
![Page 35: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/35.jpg)
JBI Packaging
![Page 36: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/36.jpg)
DEMO
• ServiceMix demo
![Page 37: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/37.jpg)
Visualization
![Page 38: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/38.jpg)
Distribution of ServiceMix Containers
![Page 39: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/39.jpg)
Apache ServiceMix
4.0
![Page 40: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/40.jpg)
Lessons Learned From JBI 1.0
✓Normalized Exchange and Messages✓Normalized Message Router✓The only way to plug in third party components
๏XML normalization can be problematic ๏Packaging/classloaders not very flexible ๏Creating components is not easy๏Not always the best fit for a given API
![Page 41: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/41.jpg)
ServiceMix 4.0 Building Blocks
• Runtime: OSGi (Apache Felix)– JBI support still intact – NMR is an OSGi service
• Message Broker: Apache ActiveMQ• Web Services: Apache CXF• Routing Engine: Apache Camel
![Page 42: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/42.jpg)
ServiceMix 4 Architecture
![Page 43: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/43.jpg)
ServiceMix 4 Architecture
![Page 44: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/44.jpg)
What is Apache Camel?
http://activemq.apache.org/camel/
![Page 45: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/45.jpg)
What is EIP?
![Page 46: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/46.jpg)
Example Pattern: Content Based Router
RouteBuilder MyRoute = new RouteBuilder() { public void configure() { from("activemq:TEST.QUEUE").choice() .when(header("foo").isEqualTo("bar"))
.to("file:target/foo") .when(header("foo").isEqualTo("cheese"))
.to("ftp://myserver:1234/target") .otherwise().to("log:TESTING"); }};
![Page 47: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/47.jpg)
Example Pattern: Content Based Router
<camelContext id="simpleRouteWithChoice" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="activemq:TEST.QUEUE"/> <choice> <when> <predicate> <header name="foo"/> <isEqualTo value="bar"/> </predicate> <to uri="file:target/foo"/> </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 48: Service Oriented Integration With ServiceMix](https://reader034.vdocument.in/reader034/viewer/2022042714/5550c3cab4c905fa618b5521/html5/thumbnails/48.jpg)
Thank You for Attending!
Questions?