SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
Servicemix 3.х
Сервисная шина ESB

                     Евгений Холодков
                     devclub.eu 23.04.09
Servicemix глазами клиентов
Servicemix глазами архитектора
Java Business Integration (JBI)
Servicemix глазами разработчика

• XML                                                                • Java
<beans xmlns:jms=quot;http://servicemix.apache.org/jms/1.0quot;              public class InsuranceJMSMarshaler extends DefaultConsumerMarshaler {
     xmlns:esb=quot;http://esbinaction.com/insurancequot;>
 <classpath>                                                             protected void populateMessage(Message message,
  <location>.</location>                                                       NormalizedMessage normalizedMessage) throws Exception {
   ......                                                                  if (message instanceof ObjectMessage) {
  <location>wstx-asl.jar</location>                                          ObjectMessage objectMessage = (ObjectMessage) message;
  <location>xpp3.jar</location>                                              Object payload = objectMessage.getObject();
 </classpath>                                                                Source source = JiBXUtil.marshalDocument(payload, quot;UTF-8quot;);
 <jms:consumer service=quot;esb:insuranceReceiverquot;                               normalizedMessage.setContent(source);
     endpoint=quot;jmsEndpoint“ targetService=quot;esb:insuranceDSLRouterquot;         } else {
     destinationName=quot;insurance.in“                                          throw new UnsupportedOperationException(quot;JMS message is not a
          connectionFactory=quot;#connectionFactoryquot;                                 ObjectMessagequot;);
     marshaler=quot;#InsuranceJMSMarshalerquot;/>                                  }
 <bean id=quot;InsuranceJMSMarshalerquot;                                        }
    class=quot;esb.dzone.servicemix.util.InsuranceJMSMarshalerquot;/>        }
 <bean id=quot;connectionFactoryquot;
          class=quot;org.apache.activemq.ActiveMQConnectionFactoryquot;>
  <property name=quot;brokerURLquot; value=quot;tcp://localhost:61616quot; />
 </bean>
</beans>
Mvn генерирует/управляет кодом


mvn archetype:create
 -DarchetypeGroupId=org.apache.servicemix.tooling
 -DarchetypeArtifactId=servicemix-http-provider-service-unit
 -DgroupId=org.apache.servicemix.samples
 -DartifactId=servicemix-example
Бизнес-процесс (1/2)
Бизнес-процесс (2/2)
Процесс в servicemix-e
Еще один пример
Servicemix-http компонент
Consumer                                  Provider
<http:endpoint                            <http:endpoint
                                             service=quot;test:MyProviderServicequot;
    service=quot;test:MyConsumerServicequot;
                                             endpoint=quot;myProviderquot;
   targetService=quot;test:MyServiceRoutin
                                             role=quot;providerquot;
   gSlipquot;
                                             locationURI=quot;http://localhost:8080/
    endpoint=quot;myConsumer“
                                             MyServicequot;
    role=quot;consumerquot;
                                              soapVersion=quot;1.1quot; />
   locationURI=quot;http://localhost:8192/S
   ervice/quot;
   defaultMep=quot;http://www.w3.org/20
   04/08/wsdl/in-outquot;
   soapVersion=quot;1.1quot;
   wsdlResource=quot;classpath:MyService.
   wsdlquot; />
Servicemix-saxon компонент

<beans xmlns:saxon=quot;http://servicemix.apache.org/saxon/1.0quot;
       xmlns:test=quot;http://www.mycompany.com/1.0quot;>

   <saxon:xslt service=quot;test:myTransformquot;
          endpoint=quot;myEndpointquot;
          resource=quot;classpath:transform.xslquot; />

</beans>
Servicemix-EIP компонент
•   Content-Based Router
•   Message Filter
•   Pipeline
•   Static Recipient List
•   Static Routing Slip
•   Wire Tap
•   XPath Splitter
•   Aggregator
•   Content Enricher
•   Resequencer
•   AsyncBridge
Паттерн content-based routing
<eip:content-based-router service=quot;test:routerquot; endpoint=quot;endpointquot;>
 <eip:rules>
  <eip:routing-rule>
   <eip:predicate>
    <eip:xpath-predicate xpath=quot;count(/test:echo) = 1quot;
    namespaceContext=quot;#nsContextquot; />
   </eip:predicate>
   <eip:target>
    <eip:exchange-target uri=quot;endpoint:http://test/pipeline/endpointquot; />
   </eip:target>
  </eip:routing-rule>
  <eip:routing-rule>
   <!-- there is no predicate, so this is the default destination -->
   <eip:target>
    <eip:exchange-target service=quot;test:recipientsquot; />
   </eip:target>
  </eip:routing-rule>
 </eip:rules>
</eip:content-based-router>
Паттерн routing-slip
<eip:static-routing-slip service=quot;test:routingSlipquot; endpoint=quot;endpointquot;>
 <eip:targets>
  <eip:exchange-target service=quot;test:transformRequestquot; />
  <eip:exchange-target service=quot;test:myProviderquot; />
  <eip:exchange-target service=quot;test: transformResponsequot; />
 </eip:targets>
</eip:static-routing-slip>
Servicemix-camel компонент
<!-- the JBI container -->
 <sm:container id=quot;jbiContainerquot; embedded=quot;truequot;>
  <sm:components>
    <ref id=quot;jbiquot; />
  </sm:components>
  <sm:endpoints>
    <bean:endpoint service=quot;myproject:trackerquot; endpoint=quot;trackerquot; bean=quot;#trackerquot; />
  </sm:endpoints>
 </sm:container>

 <bean id=quot;jbiquot; class=quot;org.apache.servicemix.camel.CamelJbiComponentquot; />

 <camelContext id=quot;camelContextquot; useJmx=quot;truequot;
    xmlns=quot;http://activemq.apache.org/camel/schema/springquot;>
  <package>my.project.routeBuilders</package>
 </camelContext>
Интеграционное тестирование

• Wire Tap




• SoapUI
Развертывание

• SA = jar файл
• Standalone vs web application
Итог
• Активно развивающийся ESB с открытым
  кодом
• Использует модульную JBI архитектуру
• Активно использует Maven 2
• Интегрирован со Spring-ом
• Содержит много готовых компонентов

Más contenido relacionado

La actualidad más candente

Web Security Horror Stories
Web Security Horror StoriesWeb Security Horror Stories
Web Security Horror StoriesSimon Willison
 
7주 JavaScript 실습
7주 JavaScript 실습7주 JavaScript 실습
7주 JavaScript 실습지수 윤
 
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...GeeksLab Odessa
 
XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?Yurii Bilyk
 
Damage Control
Damage ControlDamage Control
Damage Controlsintaxi
 
AngularJS Routing
AngularJS RoutingAngularJS Routing
AngularJS RoutingEyal Vardi
 
Angular Performance: Then, Now and the Future. Todd Motto
Angular Performance: Then, Now and the Future. Todd MottoAngular Performance: Then, Now and the Future. Todd Motto
Angular Performance: Then, Now and the Future. Todd MottoFuture Insights
 
Solr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsSolr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsWildan Maulana
 
AngulrJS Overview
AngulrJS OverviewAngulrJS Overview
AngulrJS OverviewEyal Vardi
 
2 teks tongkat mukjizat
2  teks tongkat mukjizat2  teks tongkat mukjizat
2 teks tongkat mukjizatSaleha Mohd
 
Net/http and the http.handler interface
Net/http and the http.handler interfaceNet/http and the http.handler interface
Net/http and the http.handler interfaceJoakim Gustin
 
AngularJS Data Binding
AngularJS Data BindingAngularJS Data Binding
AngularJS Data BindingTicore Shih
 
Zurich2007 MySQL Query Optimization
Zurich2007 MySQL Query OptimizationZurich2007 MySQL Query Optimization
Zurich2007 MySQL Query OptimizationHiệp Lê Tuấn
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile ProcessEyal Vardi
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IVisual Engineering
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS DirectivesEyal Vardi
 

La actualidad más candente (19)

Web Security Horror Stories
Web Security Horror StoriesWeb Security Horror Stories
Web Security Horror Stories
 
7주 JavaScript 실습
7주 JavaScript 실습7주 JavaScript 실습
7주 JavaScript 실습
 
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
 
XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?
 
Jsp1
Jsp1Jsp1
Jsp1
 
Damage Control
Damage ControlDamage Control
Damage Control
 
AngularJS Routing
AngularJS RoutingAngularJS Routing
AngularJS Routing
 
Angular Performance: Then, Now and the Future. Todd Motto
Angular Performance: Then, Now and the Future. Todd MottoAngular Performance: Then, Now and the Future. Todd Motto
Angular Performance: Then, Now and the Future. Todd Motto
 
Solr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsSolr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJs
 
AngulrJS Overview
AngulrJS OverviewAngulrJS Overview
AngulrJS Overview
 
2 teks tongkat mukjizat
2  teks tongkat mukjizat2  teks tongkat mukjizat
2 teks tongkat mukjizat
 
Net/http and the http.handler interface
Net/http and the http.handler interfaceNet/http and the http.handler interface
Net/http and the http.handler interface
 
AngularJS Data Binding
AngularJS Data BindingAngularJS Data Binding
AngularJS Data Binding
 
Zurich2007 MySQL Query Optimization
Zurich2007 MySQL Query OptimizationZurich2007 MySQL Query Optimization
Zurich2007 MySQL Query Optimization
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile Process
 
Retrofitting
RetrofittingRetrofitting
Retrofitting
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
 

Destacado

Por un uso responsable de la Tecnología...Cyberbulling
Por un uso responsable de la Tecnología...CyberbullingPor un uso responsable de la Tecnología...Cyberbulling
Por un uso responsable de la Tecnología...Cyberbullingasvmarie
 
Ingeniería geográfica y ambiental
Ingeniería geográfica y ambientalIngeniería geográfica y ambiental
Ingeniería geográfica y ambientalDanny
 
Viajar con el presente ii (visión chamánica)
Viajar con el presente ii (visión chamánica)Viajar con el presente ii (visión chamánica)
Viajar con el presente ii (visión chamánica)Xavier Arriaran
 
Presentaciones electronicas publicidad (PDA)_Karem cerdán pedagogía
Presentaciones electronicas publicidad (PDA)_Karem cerdán pedagogíaPresentaciones electronicas publicidad (PDA)_Karem cerdán pedagogía
Presentaciones electronicas publicidad (PDA)_Karem cerdán pedagogíaKaremzitHa Cerdan Lopez
 
Republic executive suites slideshowiii
Republic executive suites slideshowiiiRepublic executive suites slideshowiii
Republic executive suites slideshowiiiGina Barron
 
Digital Watchdog DWC-MB421TIR650 User Manual
Digital Watchdog DWC-MB421TIR650 User ManualDigital Watchdog DWC-MB421TIR650 User Manual
Digital Watchdog DWC-MB421TIR650 User ManualJMAC Supply
 
Toni_Guy Cutting Comp Cert
Toni_Guy Cutting Comp CertToni_Guy Cutting Comp Cert
Toni_Guy Cutting Comp CertRüslan Davydov
 
Arrenta alquiler garantizado
Arrenta alquiler garantizadoArrenta alquiler garantizado
Arrenta alquiler garantizadoArrenta
 
An Exploration of the Unique Ways Men Incorporate Uptalk Into Their Speech
An Exploration of the Unique Ways Men Incorporate Uptalk Into Their SpeechAn Exploration of the Unique Ways Men Incorporate Uptalk Into Their Speech
An Exploration of the Unique Ways Men Incorporate Uptalk Into Their SpeechAshley Thomas
 
Six ways to turbo charge your B2B marketing
Six ways to turbo charge your B2B marketing Six ways to turbo charge your B2B marketing
Six ways to turbo charge your B2B marketing Smart Insights
 
Síndrome del túnel del carpo y contractura de
Síndrome del túnel del carpo y contractura deSíndrome del túnel del carpo y contractura de
Síndrome del túnel del carpo y contractura deJose Flores
 
Lcr y bhe ppt 03-FISIOPATOLOGIA II, PARCIAL 2
Lcr y bhe ppt 03-FISIOPATOLOGIA II, PARCIAL 2Lcr y bhe ppt 03-FISIOPATOLOGIA II, PARCIAL 2
Lcr y bhe ppt 03-FISIOPATOLOGIA II, PARCIAL 2Fawed Reyes
 
MIRASIERRA - PASTORAL
MIRASIERRA - PASTORALMIRASIERRA - PASTORAL
MIRASIERRA - PASTORALehaza
 
Ch. 9: Documentary Expression and Popular Photography
Ch. 9: Documentary Expression and Popular PhotographyCh. 9: Documentary Expression and Popular Photography
Ch. 9: Documentary Expression and Popular PhotographyJacqueline Ramirez
 
Medida del radio terrestre
Medida del radio terrestreMedida del radio terrestre
Medida del radio terrestremirashiro81
 

Destacado (20)

Por un uso responsable de la Tecnología...Cyberbulling
Por un uso responsable de la Tecnología...CyberbullingPor un uso responsable de la Tecnología...Cyberbulling
Por un uso responsable de la Tecnología...Cyberbulling
 
EFY FLYER
EFY FLYEREFY FLYER
EFY FLYER
 
Monografiadegrado
MonografiadegradoMonografiadegrado
Monografiadegrado
 
Ingeniería geográfica y ambiental
Ingeniería geográfica y ambientalIngeniería geográfica y ambiental
Ingeniería geográfica y ambiental
 
Viajar con el presente ii (visión chamánica)
Viajar con el presente ii (visión chamánica)Viajar con el presente ii (visión chamánica)
Viajar con el presente ii (visión chamánica)
 
Presentaciones electronicas publicidad (PDA)_Karem cerdán pedagogía
Presentaciones electronicas publicidad (PDA)_Karem cerdán pedagogíaPresentaciones electronicas publicidad (PDA)_Karem cerdán pedagogía
Presentaciones electronicas publicidad (PDA)_Karem cerdán pedagogía
 
Republic executive suites slideshowiii
Republic executive suites slideshowiiiRepublic executive suites slideshowiii
Republic executive suites slideshowiii
 
Digital Watchdog DWC-MB421TIR650 User Manual
Digital Watchdog DWC-MB421TIR650 User ManualDigital Watchdog DWC-MB421TIR650 User Manual
Digital Watchdog DWC-MB421TIR650 User Manual
 
Toni_Guy Cutting Comp Cert
Toni_Guy Cutting Comp CertToni_Guy Cutting Comp Cert
Toni_Guy Cutting Comp Cert
 
Arrenta alquiler garantizado
Arrenta alquiler garantizadoArrenta alquiler garantizado
Arrenta alquiler garantizado
 
An Exploration of the Unique Ways Men Incorporate Uptalk Into Their Speech
An Exploration of the Unique Ways Men Incorporate Uptalk Into Their SpeechAn Exploration of the Unique Ways Men Incorporate Uptalk Into Their Speech
An Exploration of the Unique Ways Men Incorporate Uptalk Into Their Speech
 
Six ways to turbo charge your B2B marketing
Six ways to turbo charge your B2B marketing Six ways to turbo charge your B2B marketing
Six ways to turbo charge your B2B marketing
 
Síndrome del túnel del carpo y contractura de
Síndrome del túnel del carpo y contractura deSíndrome del túnel del carpo y contractura de
Síndrome del túnel del carpo y contractura de
 
Foça sirenler1
Foça sirenler1Foça sirenler1
Foça sirenler1
 
Pleno minggu 2
Pleno minggu 2Pleno minggu 2
Pleno minggu 2
 
Lcr y bhe ppt 03-FISIOPATOLOGIA II, PARCIAL 2
Lcr y bhe ppt 03-FISIOPATOLOGIA II, PARCIAL 2Lcr y bhe ppt 03-FISIOPATOLOGIA II, PARCIAL 2
Lcr y bhe ppt 03-FISIOPATOLOGIA II, PARCIAL 2
 
MIRASIERRA - PASTORAL
MIRASIERRA - PASTORALMIRASIERRA - PASTORAL
MIRASIERRA - PASTORAL
 
Burocracia..
Burocracia..Burocracia..
Burocracia..
 
Ch. 9: Documentary Expression and Popular Photography
Ch. 9: Documentary Expression and Popular PhotographyCh. 9: Documentary Expression and Popular Photography
Ch. 9: Documentary Expression and Popular Photography
 
Medida del radio terrestre
Medida del radio terrestreMedida del radio terrestre
Medida del radio terrestre
 

Similar a Devclub Servicemix Jevgeni Holodkov 23 04 09

Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixBruce Snyder
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone InteractivityEric Steele
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Librariesjeresig
 
And the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportAnd the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportBen Scofield
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
Ajax и будущее Java Script
Ajax и будущее Java ScriptAjax и будущее Java Script
Ajax и будущее Java ScriptConstantin Kichinsky
 
Ajax On S2 Odp
Ajax On S2 OdpAjax On S2 Odp
Ajax On S2 Odpghessler
 
JavaServer Faces Anti-Patterns and Pitfalls
JavaServer Faces Anti-Patterns and PitfallsJavaServer Faces Anti-Patterns and Pitfalls
JavaServer Faces Anti-Patterns and PitfallsDennis Byrne
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileChris Toohey
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2borkweb
 
Lecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPLecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPyucefmerhi
 

Similar a Devclub Servicemix Jevgeni Holodkov 23 04 09 (20)

Ridingapachecamel
RidingapachecamelRidingapachecamel
Ridingapachecamel
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
Seam Glassfish Slidecast
Seam Glassfish SlidecastSeam Glassfish Slidecast
Seam Glassfish Slidecast
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
Myfacesplanet
MyfacesplanetMyfacesplanet
Myfacesplanet
 
Riding Apache Camel
Riding Apache CamelRiding Apache Camel
Riding Apache Camel
 
Ajax
AjaxAjax
Ajax
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Libraries
 
And the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportAnd the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack Support
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Postman On Steroids
Postman On SteroidsPostman On Steroids
Postman On Steroids
 
สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1
 
Ajax и будущее Java Script
Ajax и будущее Java ScriptAjax и будущее Java Script
Ajax и будущее Java Script
 
Ajax On S2 Odp
Ajax On S2 OdpAjax On S2 Odp
Ajax On S2 Odp
 
JavaServer Faces Anti-Patterns and Pitfalls
JavaServer Faces Anti-Patterns and PitfallsJavaServer Faces Anti-Patterns and Pitfalls
JavaServer Faces Anti-Patterns and Pitfalls
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for Mobile
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
Lecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPLecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITP
 
WCF 4.0
WCF 4.0WCF 4.0
WCF 4.0
 

Devclub Servicemix Jevgeni Holodkov 23 04 09

  • 1. Servicemix 3.х Сервисная шина ESB Евгений Холодков devclub.eu 23.04.09
  • 5. Servicemix глазами разработчика • XML • Java <beans xmlns:jms=quot;http://servicemix.apache.org/jms/1.0quot; public class InsuranceJMSMarshaler extends DefaultConsumerMarshaler { xmlns:esb=quot;http://esbinaction.com/insurancequot;> <classpath> protected void populateMessage(Message message, <location>.</location> NormalizedMessage normalizedMessage) throws Exception { ...... if (message instanceof ObjectMessage) { <location>wstx-asl.jar</location> ObjectMessage objectMessage = (ObjectMessage) message; <location>xpp3.jar</location> Object payload = objectMessage.getObject(); </classpath> Source source = JiBXUtil.marshalDocument(payload, quot;UTF-8quot;); <jms:consumer service=quot;esb:insuranceReceiverquot; normalizedMessage.setContent(source); endpoint=quot;jmsEndpoint“ targetService=quot;esb:insuranceDSLRouterquot; } else { destinationName=quot;insurance.in“ throw new UnsupportedOperationException(quot;JMS message is not a connectionFactory=quot;#connectionFactoryquot; ObjectMessagequot;); marshaler=quot;#InsuranceJMSMarshalerquot;/> } <bean id=quot;InsuranceJMSMarshalerquot; } class=quot;esb.dzone.servicemix.util.InsuranceJMSMarshalerquot;/> } <bean id=quot;connectionFactoryquot; class=quot;org.apache.activemq.ActiveMQConnectionFactoryquot;> <property name=quot;brokerURLquot; value=quot;tcp://localhost:61616quot; /> </bean> </beans>
  • 6. Mvn генерирует/управляет кодом mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-http-provider-service-unit -DgroupId=org.apache.servicemix.samples -DartifactId=servicemix-example
  • 11. Servicemix-http компонент Consumer Provider <http:endpoint <http:endpoint service=quot;test:MyProviderServicequot; service=quot;test:MyConsumerServicequot; endpoint=quot;myProviderquot; targetService=quot;test:MyServiceRoutin role=quot;providerquot; gSlipquot; locationURI=quot;http://localhost:8080/ endpoint=quot;myConsumer“ MyServicequot; role=quot;consumerquot; soapVersion=quot;1.1quot; /> locationURI=quot;http://localhost:8192/S ervice/quot; defaultMep=quot;http://www.w3.org/20 04/08/wsdl/in-outquot; soapVersion=quot;1.1quot; wsdlResource=quot;classpath:MyService. wsdlquot; />
  • 12. Servicemix-saxon компонент <beans xmlns:saxon=quot;http://servicemix.apache.org/saxon/1.0quot; xmlns:test=quot;http://www.mycompany.com/1.0quot;> <saxon:xslt service=quot;test:myTransformquot; endpoint=quot;myEndpointquot; resource=quot;classpath:transform.xslquot; /> </beans>
  • 13. Servicemix-EIP компонент • Content-Based Router • Message Filter • Pipeline • Static Recipient List • Static Routing Slip • Wire Tap • XPath Splitter • Aggregator • Content Enricher • Resequencer • AsyncBridge
  • 14. Паттерн content-based routing <eip:content-based-router service=quot;test:routerquot; endpoint=quot;endpointquot;> <eip:rules> <eip:routing-rule> <eip:predicate> <eip:xpath-predicate xpath=quot;count(/test:echo) = 1quot; namespaceContext=quot;#nsContextquot; /> </eip:predicate> <eip:target> <eip:exchange-target uri=quot;endpoint:http://test/pipeline/endpointquot; /> </eip:target> </eip:routing-rule> <eip:routing-rule> <!-- there is no predicate, so this is the default destination --> <eip:target> <eip:exchange-target service=quot;test:recipientsquot; /> </eip:target> </eip:routing-rule> </eip:rules> </eip:content-based-router>
  • 15. Паттерн routing-slip <eip:static-routing-slip service=quot;test:routingSlipquot; endpoint=quot;endpointquot;> <eip:targets> <eip:exchange-target service=quot;test:transformRequestquot; /> <eip:exchange-target service=quot;test:myProviderquot; /> <eip:exchange-target service=quot;test: transformResponsequot; /> </eip:targets> </eip:static-routing-slip>
  • 16. Servicemix-camel компонент <!-- the JBI container --> <sm:container id=quot;jbiContainerquot; embedded=quot;truequot;> <sm:components> <ref id=quot;jbiquot; /> </sm:components> <sm:endpoints> <bean:endpoint service=quot;myproject:trackerquot; endpoint=quot;trackerquot; bean=quot;#trackerquot; /> </sm:endpoints> </sm:container> <bean id=quot;jbiquot; class=quot;org.apache.servicemix.camel.CamelJbiComponentquot; /> <camelContext id=quot;camelContextquot; useJmx=quot;truequot; xmlns=quot;http://activemq.apache.org/camel/schema/springquot;> <package>my.project.routeBuilders</package> </camelContext>
  • 18. Развертывание • SA = jar файл • Standalone vs web application
  • 19. Итог • Активно развивающийся ESB с открытым кодом • Использует модульную JBI архитектуру • Активно использует Maven 2 • Интегрирован со Spring-ом • Содержит много готовых компонентов