Spring and SOA (2006)

607 views

Published on

Presentation from the good old days when we thought SOA was the golden hammer.

Detailing some implementations like Spring/XFire, JAXB and ServiceMix.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
607
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Spring and SOA (2006)

  1. 1. Spring and SOA Merelbeke, 7/11/2006
  2. 2. Agenda What is SOA JAXB2, Spring WS en XFire JBI and the ESB ServiceMix
  3. 3. About SOA SERVICE ORIENTED ARCHITECTURE
  4. 4. What is “Service Oriented Architecture”? "Things should be made as simple as possible, but no simpler." -- Albert Einstein Applications build on Loosely Coupled Services ◦ Distributed resources ◦ Made available as independent services ◦ Services that are interoperable ◦ Interoperability based on contracts Separation of Concerns
  5. 5. Elements of SOA
  6. 6. Stages of SOA
  7. 7. Fundamental SOA Only basic services ◦ Data-centric: exposes resources ◦ Logic-centric: encapsulate business rules Resources are never shared between services Better Maintainability
  8. 8. Networked SOA Introduce intermediate services ◦ Techonology Gateways ◦ Adapters ◦ Façades (?) ◦ Decorating services Easier integration into Application frontends More Flexibility
  9. 9. Process-Enabled SOA Introduce process-centric service(s) ◦ Statefull intermediate service ◦ Hides process state from application frontend ◦ Process state can be shared for multiple users ◦ Can be event driven Application frontend concentrates on User Interface (GUI or B2B) Full Separation of Concerns
  10. 10. Implementing basic Services
  11. 11. Implementing Services Traditional Web Services: RPC ◦ Remote Procedure Call SOA Web Services: contract first ◦ First define the messages, then implement the code ◦ Maximum interoperability
  12. 12. JAXB 2: Java Architecture for XML Binding Java 6 standard extension for Java/XML Binding SchemaGen: generate xsd/wsdl from java pojo’s ◦ Customisable with javax.xml.bind annotations ◦ javax.jws @WebService/ @WebMethod annotations XJC: generate java from xsd/wsdl ◦ Generate pojo’s with javax.xml.bind/javax.jws annotations ◦ Customisable with xsd annotations or binding files ◦ Plugin API for e.g. naming conventions or generating EJB3 annotations ◦ Ant task, maven plugin, eclipse plugin Code example
  13. 13. Implementing services with XFire and Spring Codehaus XFire: next generation java SOAP ◦ Support for newest standards: ◦ JAXB 2.0: annotation based XML binding ◦ JSR-181/JAX-WS 2.0: annotations for WSDL generation ◦ POJO based ◦ Integration with Spring-core and Spring-MVC Code example
  14. 14. Implementing services with Spring-WS Document-driven web services ◦ Can use XML directly as SAX, DOM, StAX… ◦ For efficiency, flexibility ◦ Can plugin Castor/JAXB/JiBX Marshallers Similar architecture as Spring-MVC ◦ Configurable Dispatcher ◦ Endpoints as Controllers ◦ Mappings/Filters/Interceptors… Code example
  15. 15. JBI and the ESB JAVA BUSINESS INTEGRATION
  16. 16. About JBI Standards based API for Service Bus in a SOA Normalized Message Router API Container API for deploying Service Engines and Binding Components ◦ Service Engine ◦ Business logic service ◦ Transformation service ◦ Integration of multiple services ◦ Binding Component ◦ Connectivity to external services ◦ Consumer or provider
  17. 17. JBI Message interfaces NormalizedMessage ◦ content: XML ◦ attachments: name -> Mime content ◦ properties: name -> object ◦ security subject: authentication subject MessageExchange: W3C Message exchange patterns ◦ messages: name -> normalized message ◦ exchange id: GUID ◦ endpoint: service endpoint ◦ service, interface name, operation: QName ◦ subinterfaces: InOnly, InOptionalOut, InOut, RobustInOnly ◦ status: ACTIVE, DONE, ERROR
  18. 18. JBI Component interfaces Component ◦ Lifecycle interface for service units ServiceEndpoint ◦ Addres of a service ◦ List of interfaces ◦ List of operations ComponentContext ◦ Callbacks for service units ◦ Get delivery channel: accept/send MessageExchange ◦ Get other ServiceEndpoints
  19. 19. ServiceMix JBI Container AN AGILE ENTERPRISE SERVICE BUS POWERED BY SPRING
  20. 20. ServiceMix JBI Container Bindings for common Java Technologies ◦ SOAP Bindings: plain HTTP/SOAP, jsr-181, X-Fire, ... ◦ JMS Binding for plain JMS and JMS+SOAP ◦ Quartz scheduler consumer binding ◦ FTP provider and consumer ◦ Bindings for JavaMail, HTTP, RSS, jabber ... Service Engines ◦ Generic Routing patterns: router, filter, splitter, aggregator, ... ◦ XSLT transformation ◦ Support for BPEL engines: Intalio PXE en Apache ODE ◦ Support for Oracle XSQL JBI Component Adaptors for POJO’s ◦ Real POJO’s: use reflection ◦ Implement JBI interfaces or use annotations
  21. 21. Using ServiceMix Deployment options ◦ Standalone container with hot-deploy ◦ Bundled with Apache Geronimo J2EE container ◦ JBoss deployer Spring based configuration ◦ XML namespaces avant la lettre Code example

×